0

I would like to create a scatter plot, but somehow when I tried it with the code below I got a boxplot for one of the data and a scatter plot for the other.

How can I convert the boxplot code to scatter plot?

plot(Effect[Oil=="Neem"] ~ Hours[Oil=="Neem"], data = 
       pedrep, xlim = range(1:8), ylim= range(Effect), col= "Green", ylab = "Repellence", 
     xlab= "Period of exposure", main="Paederus Repellence") 
points(Effect[Oil=="Cinnamon"] ~ Hours[Oil=="Cinnamon"], data = 
         pedrep,xlim = range(1:8), ylim= range(Effect), col= "red", ylab = "Repellence", 
       xlab= "Period of exposure", main="Paederus Repellence")

enter image description here

Rui Barradas
  • 57,195
  • 8
  • 29
  • 57
Athira
  • 1
  • 4
    Can you post sample data? Please edit **the question** with the output of `dput(pedrep)`. Or, if it is too big with the output of `dput(head(pedrep, 20))`. Is `Hours` a factor? Check with `str(pedrep)` or with `class(pedrep$Hours)`. If it is [transform to numeric](https://stackoverflow.com/questions/3418128/how-to-convert-a-factor-to-integer-numeric-without-loss-of-information) and retry. – Rui Barradas Oct 23 '21 at 15:45

0 Answers0