I am trying to create a summary table of the mean ± standard error. So far I have managed to extract the mean and se columns from the SummarySE function, however I am now stuck and can't figure out how to get the column and row names.
Data:
> example
TREATMENT TIME Species 1 Species 2 Species 3 Species 4
1 A 0 1.649636 2.360214 2.196063 2.009818
2 A 0 1.657400 2.309308 2.282143 2.760400
3 A 0 1.581909 3.010182 3.055833 3.553500
4 B 0 1.636500 2.019500 2.169867 2.390857
5 B 0 1.750750 1.971071 2.066550 3.001389
6 B 0 1.838250 2.076143 2.541667 2.835000
7 C 0 2.247000 1.853071 1.812714 2.253111
8 C 0 1.955571 2.269500 1.895667 3.007917
9 C 0 2.352364 2.292867 2.322700 2.559333
Attempt:
library(Rmisc)
library(Reshape2)
melt <- melt(example, id=c("TREATMENT", "TIME"), value.name="growth", variable.name = "Species")
x <- summarySE(melt, measurevar = "growth", groupvars = c("TIME", "TREATMENT", "Species") )
xmean<-signif(x[,5],digits=3)
xse<-signif(x[,7],digits=3)
x<-paste(xm,xse,sep=" u00b1 ")
x
Produces:
[1] "1.63 ± 0.024" "2.56 ± 0.226" "2.51 ± 0.273" "2.77 ± 0.446" "1.74 ± 0.0584" "2.02 ± 0.0304" "2.26 ± 0.144"
I have a feeling I am going about this the long way...
