[R] lapply item names

jim holtman jholtman at gmail.com
Sat Nov 1 16:43:57 CET 2008


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?



More information about the R-help mailing list