简体   繁体   中英

Side-by-side box plots of data (in one plot) in R

boxplot(s2040_W20_fishjump$Distance, main = "Fish Jump Distance", xlab = "Control vs Treatment", ylab = "Distance")

Returns me a single plot, with proper labels but only one boxplot. I need to divide the plots based on Control vs Treatment, and cannot figure out how.

Here is the data set I am working with

这是我正在使用的数据集

Any help would be appreciated, thanks.

Use the tilda:

boxplot(s2040_W20_fishjump$Distance ~ s2040_W20_fishjump$Treatment, main = "Fish Jump Distance", xlab = "Control vs Treatment", ylab = "Distance")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM