I want to create a table which includes(Mean, SD and Range) for stop types. I used the following but I got two problems clear in the result table:
The labels of the first row (Mean) and the second row (SD) are missing. How can I include them with keeping the values rounded?
I want to create a row for (Range) to include (Min:Max) together, separated by a colon. It gives wrong results. how can I correct that?
df<-NKurdish
attach(df)
Mean<-tapply(NKurdish$VOT, NKurdish$Stop, mean)
SD<-tapply(NKurdish$VOT, NKurdish$Stop, sd)
Min<-tapply(NKurdish$VOT,NKurdish$Stop, min)
Max<-tapply(NKurdish$VOT,NKurdish$Stop, max)
Range<-tapply(Min, Max)
rbind(round(Mean),round(SD),Min,Max, Range)
detach(df)
result
b d g k p t
-117 -130 -117 84 55 66
37 33 28 18 12 18
Min -220 -219 -200 50 39 40
Max -60 -70 -42 118 84 111
Range 2 1 3 6 4 5