-1

my data set contains 18 variables, 2 of them being PM2.5 and rain, the rain variable takes values from 0 to 20, how do I make a single boxplot of PM2.5 against rain for all values of rain > 0 instead of multiple different boxplots for each value that rain takes. This is the code for the boxplots

> boxplot(PM2.5~RAIN, subset(data, RAIN > 0 & hour==12))

a picture of the boxplots enter image description here

UseR10085
  • 7,120
  • 3
  • 24
  • 54
Drillaa
  • 3
  • 1
  • Please include a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) of your data. – user438383 Apr 08 '21 at 20:18

1 Answers1

1

boxplot(data[(data$RAIN > 0) & (data$hour == 12), 'PM2.5'])

rossdrucker9
  • 439
  • 3
  • 11