r - l_ply: creating plots from a list of data frames of groupedData class -
im new r user i'll try post correctly...... have r list this:
> summary(groupdata_ls) length class mode 5 3 nfngroupeddata list 10 3 nfngroupeddata list 15 3 nfngroupeddata list
i've made function create groupeddata object variables 'lma','campaign', , 'id' grouping factor. used function inside dlply create list of groupeddata objects, splitting original data frame 'volume' (5, 10, 15, etc). code generates list above:
grp_func <- function(dfr){ sub_dfr <- subset(dfr, select = c("id", "campaign", "sla")) sla.new <- groupeddata(sla ~ campaign|id, data=sub_dfr) } groupdata_ls<- dlply(dfr, .(volume) , grp_func)
i use l_ply generate trellis plots (lma ~ campaign) each volume.
i can generate them subset of 1 volume (15) raw dfr:
vol_15 <- dfr[dfr$volume == "15",] sla_15 <- groupeddata( sla ~ campaign | id, data = vol_15) plot(sla_15)
i've kinda reached peak of plyr skills @ point. class of groupeddata objects tripping me when attempting make plots in l_ply. not sure do....help please.
cheers!
Comments
Post a Comment