[R] Question re matplot

Marc Schwartz marc_schwartz at comcast.net
Sun Oct 14 05:10:38 CEST 2007

On Sat, 2007-10-13 at 22:00 -0500, David Kaplan wrote:
> Hi,
> I have the following script for matplot
> matplot(battingagg$X, battingagg[, c("HR","RBI","X2B", "BB", 
> "R", "SB")], type="b",lty=4,lwd=2, col=1:4,xlab = "Year", 
> ylab "(1)HRs, (2)RBIs, (3)DOUBLES,(4)BB,(5)Runs,(6) BB", 
> pty="m",sub = "Figure 2.  Plot of Selected Offensive 
> Baseball Statistics: 1901 - 2005",)
> The problem I'm having is with ylab.  It seems not to be 
> giving the entire label, but rather cuts of the first 3 
> variables giving me only (4)BB,(5)Runs,(6) BB.   How can I 
> get it to print the entire label?
> Thanks in advance.
> David

Is the above an exact copy of your script?

If yes, what happens when you remember to put an '=' sign after
'ylab'?  :-)

Also, you appear to have a superfluous ',' at the end of the function
call, prior to the final close paren.


Marc Schwartz

More information about the R-help mailing list