I use the following script and I obtain a missconfigured legends. Do you know the reason?
barplot(x, main="Especies y Grupos", beside=TRUE, col=c("red","green3","blue"), xlab="Grupos", ylab="Frecuencia")
Añadir la leyenda en la parte superior izquierda
legend("topleft", legend=rownames(x), fill=c("red","green3","blue"))
Thank you very much in advance!
Configure the legend plot and put in the side correct