Re: [R] apply and plot

From: Marc Schwartz (via MN) <mschwartz_at_mn.rr.com>
Date: Fri 14 Oct 2005 - 02:22:15 EST

On Thu, 2005-10-13 at 14:50 +0100, Luis Ridao Cruz wrote:
> R-help,
>
> I use the code below to plot some data by applying "apply" function.
> But I don't know how I can get the argument "type" or "col" on the
> "plot" function to distinguish the different lines
> in the graph:
>
> apply ( my.data, 2, function ( x ) lines ( dimnames ( my.data ) [[1]] ,
> x ) )
>
>
> Thank you in advance

Rather than trying the use the construct above, take a look at ?matlines and/or ?matplot (both on the same help page with ?matpoints.)

I think that you will find these purposefully designed functions better suited to what I believe you are trying to do here.

HTH, Marc Schwartz



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Oct 14 02:34:22 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 18:50:35 EST