I'm having trouble creating bar plots in R. The odd thing is that I've used the same script before with different variables without any issues, so I don't really know what is going on (I'm fairly new to R).
The code I've been using is (with transposed matrix):
barplot(StandtF, main="h2, c2, e2 by Mod FEMALES",
xlab="Social Support", ylab="% of Var", beside=TRUE, axesnames=TRUE,
names.arg=c("No","Yes"),
col=c("red","green","darkblue"))
legend("topleft",c("h2","c2","e2"),fill=c("red","green","darkblue") )
And the error message that's returned is:
Error in barplot.default(StandtM, main = "h2, c2, e2 by Mod FEMALES", xlab = "Social Support", : incorrect number of names In addition: Warning message: In plot.window(xlim, ylim, log = log, ...) : "axesnames" is not a graphical parameter
I've looked around at different posts, but nothing so far has been helpful. And as said, the script has worked fine previously.
Any help would be greatly appreciated.