Say I have an R list like this:
> summary(data.list)
Length Class Mode
aug9104AP 18 data.frame list
Aug17-10_acon_7pt_dil_series_01 18 data.frame list
Aug17-10_Picro_7pt_dil_series_01 18 data.frame list
Aug17-10_PTZ_7pt_dil_series_01 18 data.frame list
Aug17-10_Verat_7pt_dil_series_01 18 data.frame list
I want to process each data.frame in the list using l_ply
, but I also need the name (e.g. aug9104AP) to be passed into the processing function along with the data.frame. Something like:
l_ply(data.list,function(df,...) {
cli.name<- arg_to_access_current_list_item_name
#make plots with df, use cli.name in plot titles
#save results in a file called cli.name
}, arg_to_access_current_list_item_name
)
What should arg_to_access_current_list_item_name
be?