Skip to content
Prev 316361 / 398506 Next

Thank you your help and one more question.

Hi,

I think I understand your mistake.
imput1_2_3<-list(imp1=structure(list(ID = c("HM001", "HM001", "HM001", "HM001", "HM001",
"HM001", "HM001", "HM001", "HM001", "HM001", "HM001", "HM001",
"HM001", "HM001", "HM001"), CTIME = 1223:1237, WEIGHT = c(24.9,
25.2, 25.5, 25.24132, 25.7, 27.1, 27.3, 27.4, 28.4, 29.2, 30.1377,
31.17251, 32.4, 33.7, 34.3)), .Names = c("ID", "CTIME", "WEIGHT"
), class = "data.frame", row.names = c("1", "2", "3", "4", "5",
"6", "7", "8", "9", "10", "11", "12", "13", "14", "15")),
imp2=structure(list(ID = c("HM001", "HM001", "HM001", "HM001", "HM001",
"HM001", "HM001", "HM001", "HM001", "HM001", "HM001", "HM001",
"HM001", "HM001", "HM001"), CTIME = 1223:1237, WEIGHT = c(24.9,
25.2, 25.5, 25.54828, 25.7, 27.1, 27.3, 27.4, 28.4, 29.2, 29.8977,
31.35045, 32.4, 33.7, 34.3)), .Names = c("ID", "CTIME", "WEIGHT"
), class = "data.frame", row.names = c("1", "2", "3", "4", "5",
"6", "7", "8", "9", "10", "11", "12", "13", "14", "15")),
imp3=structure(list(ID = c("HM001", "HM001", "HM001", "HM001", "HM001",
"HM001", "HM001", "HM001", "HM001", "HM001", "HM001", "HM001",
"HM001", "HM001", "HM001"), CTIME = 1223:1237, WEIGHT = c(24.9,
25.2, 25.5, 25.46838, 25.7, 27.1, 27.3, 27.4, 28.4, 29.2, 30.88185,
31.57952, 32.4, 33.7, 34.3)), .Names = c("ID", "CTIME", "WEIGHT"
), class = "data.frame", row.names = c("1", "2", "3", "4", "5",
"6", "7", "8", "9", "10", "11", "12", "13", "14", "15")))
?imput<- list(imput1_2_3[1],imput1_2_3[2],imput1_2_3[3]) #what you tried.? You should use [[ ]]instead of [].? Here, it is not necessary
aggregate(.~ID+CTIME,data=imput,mean)
#Error in eval(expr, envir, enclos) : object 'ID' not found

#You don't need the above step.
class(imput1_2_3) #already a list
[1] "list"
?imput<-do.call(rbind,imput1_2_3)
?aggregate(.~ID+CTIME,data=imput,mean)
? # ?? ID CTIME?? WEIGHT
#1? HM001? 1223 24.90000
#2? HM001? 1224 25.20000
#3? HM001? 1225 25.50000
#4? HM001? 1226 25.41933
#5? HM001? 1227 25.70000
#6? HM001? 1228 27.10000
#7? HM001? 1229 27.30000
#8? HM001? 1230 27.40000
#9? HM001? 1231 28.40000
#10 HM001? 1232 29.20000
#11 HM001? 1233 30.30575
#12 HM001? 1234 31.36749
#13 HM001? 1235 32.40000
#14 HM001? 1236 33.70000
#15 HM001? 1237 34.30000
A.K.
Message-ID: <1359438483.29923.YahooMailNeo@web142603.mail.bf1.yahoo.com>
In-Reply-To: <dad80bf2b8aafd157fea0ed64b2b@tweb17.nm.nhnsystem.com>