On 05/10/2013 07:22 AM, Carol Van Hulle wrote:
Hi all,
I am trying to create a barplot for the following data:
ssmsm, ssaudmn, sstacmn
.35, .93, .63
1.9, 1.51., 1.8
.78, 1.6, 1.24
1.10, 1.60, 1.24
I used the following code:
sd<-read.table("dat.csv", header=T, sep=",")
barplot(as.matrix(sd), main="Figure 1", ylab= "Mean", beside=TRUE,
col=rainbow(3))
legend("topleft", c("low", "chronic", "remitted", "late-onset"), cex=0.6,
bty="n", fill=rainbow(3))
But I get the following error:
Error in -0.01 * height : non-numeric argument to binary operator
I get that sd needs to be a matrix, but I'm not sure why using as.matrix is not
good enough. Any suggestions?
Hi Carol,
It is probably the extra "." in the value 1.51
Jim
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.