Re: [R] lapply item names

From: jim holtman <jholtman_at_gmail.com>
Date: Sat, 01 Nov 2008 11:43:57 -0400

lapply(names(dataSet), function(.name) plotFunction(dataSet[[.name]], main=.name))

On Sat, Nov 1, 2008 at 10:31 AM, Chibisi Chima-Okereke <chibco_at_gmail.com> wrote:
> Dear all,
>
> I am using lapply to generate plots by applying a plot function to a list of
> dataframes. e.g.
>
> lapply(dataSet, FUN = plotFunction)
>
> Is there a way to call the list item number inside the plot function so that
> I can identify each graph?
>
> Thanks
>
> Chibisi
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_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.
>

-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?

______________________________________________
R-help_at_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.
Received on Sat 01 Nov 2008 - 15:48:43 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 01 Nov 2008 - 18:30:21 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive