I have a nested list containing a set of data.frame objects in it, now I want them to be smoothed out. I used the most common approach, for example, the unlist method, it did not adjust my list, the result was not sufficiently presented. How can I do this more efficiently? Does anyone know of any trick in performing this operation? Thank.
Example:
mylist <- list(pass=list(Alpha.df1_yes=airquality[2:4,], Alpha.df2_yes=airquality[3:6,],Alpha.df3_yes=airquality[2:5,],Alpha.df4_yes=airquality[7:9,]),
fail=list(Alpha.df1_no=airquality[5:7,], Alpha.df2_no=airquality[8:10,], Alpha.df3_no=airquality[13:16,],Alpha.df4_no=airquality[11:13,]))
I tried like this: it works, but the result was not arranged correctly.
res <- lapply(mylist, unlist)
after smoothing, I would like to combine them without duplication:
out <- lapply(res, rbind.data.frame)
my desired result:
mylist[[1]]$pass:
Ozone Solar.R Wind Temp Month Day
2 36 118 8.0 72 5 2
3 12 149 12.6 74 5 3
4 18 313 11.5 62 5 4
How to make this kind of anti-aliasing more compatible? Can anyone suggest a possible idea to do this in R? Many thanks.