Hello, I have a list of 7 data frames, each data frame having 24 rows (hour of the day) and 5 columns (weeks) with a total of 5 x 24 values
I would like to combine all 7 columns of week 1 (and 2 ...) in a separate data frame for hourly calculations, e.g. > apply(new.data.frame,1,mean) In some way sapply (lapply) works, but I cannot directly select columns of the original data frames in the list. As a workaround I have to select a range of values: > sapply(list_of_dataframes,"[",1:24) Values 1:24 give the first column, 25:48 the second and so on. Is there an easier / more direct way to select for specific columns instead of selecting a range of values, avoiding loops? Cheers, Wolfgang ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.