A data.frame with values of groups, for example:
> mydata
GROUP_ID MTT.41 MTT.75 MTT.52 MTT.17
1 H_R 0.001083927 0.50712152 0.00000000 0.56629745
2 H_R 0.360328275 0.04732368 0.32462995 0.12098075
3 H_R 0.338494890 0.09820813 0.30385217 0.19109582
4 H_NR 0.348559926 0.71605789 0.37487359 0.96580277
5 H_NR 0.515484670 0.38720423 0.69757286 0.70835574
6 H_NR 0.415918241 0.51160120 0.04753149 0.36175933
7 H_NR 0.472592134 0.04135079 0.00000000 0.02387354
Then, melting:
> meltdata <- melt(mydata, measure.vars = 2:5)
and ploting:
> ggplot(meltdata, aes(value, x=variable, fill=GROUP_ID))+geom_boxplot()
You can got this:
Or alternatively:
> ggplot(meltdata, aes(value, x=GROUP_ID, fill=variable))+geom_boxplot()
You got this:
No comments:
Post a Comment