I'm just asking how to transform from categorical variables to quantitative variables so as to make a boxplot.
My command is:
wiser_perc<-read.csv("Perca_fluviatilis.csv",header=T, sep=";")
attach(wiser_perc)
summary(wiser_perc)
Country
Sweden :156
Germany: 73
France : 67
Norway : 19
Estonia: 8
(Other):7
Diversity
1,66E+00: 8
1,28E+00: 6
1,64E+00: 5
1,76E+00: 5
2,01E+00: 5
2,36E+00: 5
(Other):299
boxplot(Diversity~Country, data=wiser_perc,boxwex=0.7,cex.axis=0.8,ylab="Size diversity")
Error in boxplot.default(split(mf[[response]], mf[-response]), ...) :
adding class "factor" to an invalid object
#
So, I don't know how to change the variable "Diversity" to a quantitative variable.
Please, I'm stuck in that problem.