Gene Hammel <[EMAIL PROTECTED]> writes:

> My apologies for asking what is doubtless a dumb question, but I have
> scant experience in R.
> 
> It would be very convenient in doing lots of plots to be able to do
> them in a loop that stepped through a vector of variable names. For
> example one could say
> 
> 
> x<-("mydates")

   You misquoted that line.  There is no function before the (

> y<-c("foo1","foo2","foo3") #where "foon" were vectors
> plot(x,y[1],type="n")
> points(x,y[1])
> points(x,y[2],pch=2)
> points(x,y[3],pch=3)
> 

The general approach in R is often called "whole object".  That is,
you try to put your data into a structure that will facilitate the
operations you wish to perform.  In this case bind the responses into
a matrix and use matplot

matplot(x, cbind(foo1, foo2, foo3), type = 'p')

-- 
Douglas Bates                            [EMAIL PROTECTED]
Statistics Department                    608/262-2598
University of Wisconsin - Madison        http://www.stat.wisc.edu/~bates/

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to