使用R中的纵向数据绘制3d表面

时间:2015-03-06 02:22:18

标签: r plot 3d ggplot2

我的数据格式如下:

Time Endpoint.Value PlasmaConc Group AnimalID
 0        120          .8        1      1
 2        140          .4        1      1
 4        115          .2        1      1
 8        108          .1        1      1
 24       100          .0        1      1
 0        115          .9        1      2
 2        130          .7        1      2
 4        112          .4        1      2
 8        110          .3        1      2
 24       107          .1        1      2
 ...
 0        112          .6        1      12
 2        104          .5        1      12
 4        98           .2        1      12
 8        78           .15       1      12
 24       58           .08       1      12



endpointPlot <- ggplot(data = allData, aes(x = Time, y = Endpoint.Value, group = Group, color = Group)) + geom_point()+
  stat_summary(geom = "point", fun.y = mean, shape = 17, size = 7)+
  stat_smooth(aes(fill = Group))+
  ggtitle("Endpoint (Glucose) vs Time with smoothed standard errors by Group")

concentrationPlot <- ggplot(data = allData, aes(x = Time, y = PlasmaConc, group = Group, color = Group)) + geom_point()+
  stat_summary(geom = "point", fun.y = mean, shape = 17, size = 7)+
  stat_smooth(aes(fill = Group))+
  ggtitle("Plasma Concentration vs Time with smoothed standard errors by Group")

有没有办法用3d绘图来做到这一点?时间在一个轴上,PlasmaConc在另一个轴上,Endpoint.Value在z轴上?

谢谢!

编辑:这是所要求的信息:

前几个columsn是:

 PlasmaConc
Time 0 0.0381 0.0453 0.0708 0.0754 0.0846 0.129 0.15 0.311 0.313 0.368 0.4 0.427 0.446 0.535 0.657 0.674 0.678 0.719 0.87 0.882 0.934 1.01 1.02 1.03 1.09 1.12 1.15 1.16 1.17 1.19
  0  6      0      0      0      0      0     0    0     0     0     0   0     0     0     0     0     0     0     0    0     0     0    0    0    0    0    0    0    0    0    0
  1  6      0      0      0      0      0     0    0     0     0     0   0     0     0     0     0     0     0     0    0     0     0    1    0    0    1    0    0    0    0    0
  2  6      0      0      0      0      0     0    0     0     0     0   0     0     0     0     0     0     0     0    0     1     0    0    0    0    0    0    0    0    0    0
  4  6      0      0      0      0      0     0    0     0     0     0   0     0     0     0     0     1     1     0    0     0     0    0    0    1    0    0    1    1    0    0
  8  6      0      0      0      0      0     0    0     1     1     1   1     0     0     1     1     0     0     0    1     0     0    0    1    0    0    1    0    0    0    1

0 个答案:

没有答案