In pure R (without other packages) is IMHO simpler to understand (at
least if data are so simple: months 1 till 9 with no missing
values...). All you need is:

dummybob <- ' month A B
 Jan   8 4
 Feb   7 5
 Mar   6 8
 Apr   3 7
 May   5 1
 Jun   6 4
 Jul   2 8
 Aug   1 2
 Sep   4 3
'

bob <- read.table(textConnection(dummybob), head=TRUE,
stringsAsFactors = FALSE)

plot(0,0,"n",xlim=c(1,9),ylim=c(0,9),xlab="Month",ylab="Value",axes=FALSE)
title(main="Bob")
lines(1:9,bob$A,lty="solid",col="black")
lines(1:9,bob$B,lty="dotted",col="green")
axis(1,1:9,bob$month)
axis(2)

text(1:9,bob$A,"A",pos=3)
text(1:9,bob$B,"B",pos=3)
box()

And then repeat with the other dataset.

______________________________________________
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.

Reply via email to