Sort boxplot by mean in R - error [closed]

1

I am trying to sort my data in a boxplot graph in R, by the average, but in the last step I get an error. Below I copy the script and the error. Thanks:

>Tempranillo <- read.table("/Users/davidgramaje/Desktop/Tempranillo_def.csv", header=T, sep=",")

> attach(Tempranillo)

> names (Tempranillo)
[1] "CLON"   "LESION"

> quantile(LESION, probs=c(0, 0.25, 0.5, 0.75, 1))
     0%     25%     50%     75%    100% 
  0.000   8.000  13.811  26.000 177.183 

> boxplot (LESION~CLON, Tempranillo)

> spray2 <- with(Tempranillo, factor(CLON, levels=levels(CLON)[order(tapply(LESION,CLON,median))]))

> boxplot(LESION~spray2, Tempranillo)
  

Error in boxplot.default (split (mf [[response]], mf [-response], drop = drop,:     invalid first argument

    
asked by DavidGP 08.03.2018 в 17:58
source

0 answers