r - Grouping data by ID or seed -
i have 100 patient's data (1 total file rbind) 2 columns (time,var1). need group data (100 groups) in order able plot 100 patient's data.
i added column patientid
@ end whole data, should grouped in order generate 100 plots each patient. since need data dont want split total data.
i tried , didn't work:
data1$id <- 1 # third column has id total <- rbind(data1,data2,....) total <- grouped.data(xdata = xdata, ydatalog = ydatalog, seed = total$id) plot(total)
as example, data r works properly:
str(loblolly) classes ‘nfngroupeddata’, ‘nfgroupeddata’, ‘groupeddata’ , 'data.frame': 84 obs. of 3 variables:
plot(loblolly) # 1 plot each patient since data grouped
solution: total.new <- # create new copy object groupeddata( ydatalog ~ xdata | id, data = as.data.frame( total ),.
Comments
Post a Comment