[datatable-help] Boxplot of mean, sd, max, min without raw data

affableambler nfields at gmail.com
Tue Apr 18 16:46:57 CEST 2017


Hi Susan,

This will require reshaping the data:

data<-read.table('E:\\Libraries\\Documents\\WCM4.txt',sep='\t',header=T,stringsAsFactors
= F) 

library(reshape2)

#Melt the data into three columns with 70 rows:
melted_data<-melt(data,id.vars = 1, measure.vars = 2:6)

#Plot using ggplot2
library(ggplot2)
plot<- ggplot(data = melted_data, aes(x=x, y=value)) 
plot <- plot + stat_boxplot(geom ='errorbar',aes(group=x))  
plot <- plot + geom_boxplot(aes(group=x)) 
plot <- plot + scale_x_continuous(breaks = 1:14, labels = 1:14) 

I also noticed that in rows 2 and 14, the "upper" is greater than "ymax." 
Maybe the data was entered incorrectly?



--
View this message in context: http://r.789695.n4.nabble.com/Boxplot-of-mean-sd-max-min-without-raw-data-tp4730939p4732696.html
Sent from the datatable-help mailing list archive at Nabble.com.


More information about the datatable-help mailing list