Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 按ID或种子对数据进行分组_R - Fatal编程技术网

R 按ID或种子对数据进行分组

R 按ID或种子对数据进行分组,r,R,我有100个患者数据(1个带有rbind的总文件),共2列(时间,变量1)。 我需要对数据进行分组,以便能够绘制100名患者的数据 我在整个数据的末尾添加了一列patientID,但应该分组,以便为每个患者生成100个图。因为我需要数据在一起,所以我不想分割全部数据 我试过这个,但没用: Data1$ID <- 1 # third column now has the ID total <- rbind(Data1,Data2,....) total <- grouped.d

我有100个患者数据(1个带有rbind的总文件),共2列(时间,变量1)。 我需要对数据进行分组,以便能够绘制100名患者的数据

我在整个数据的末尾添加了一列
patientID
,但应该分组,以便为每个患者生成100个图。因为我需要数据在一起,所以我不想分割全部数据

我试过这个,但没用:

Data1$ID <- 1  # third column now has the ID
total <- rbind(Data1,Data2,....)
total <- grouped.data(xdata = xdata, ydatalog = ydatalog, seed = total$ID)
plot(total)

绘图(LOBLLY)#由于数据已分组,因此每个患者有一个绘图

解决方案:总计。新建要一个绘图显示所有组还是多个绘图?多个绘图。但是,我需要使用nmle分析整个数据(因此应根据患者ID进行分组)。例如:fm1解决方案:total.new您可以回答你自己的问题,然后标记正确!
str(Loblolly)
Classes ‘nfnGroupedData’, ‘nfGroupedData’, ‘groupedData’ and 'data.frame':      84 obs. of  3 variables: