and list names not available
If you must use lapply then do it over the names rather than the
data:
lapply(names(people), function(nm) plot(1:10, people[[nm]], main = nm))
On Feb 5, 2008 11:47 AM, john seers (IFR) <[EMAIL PROTECTED]> wrote:
>
>
> Hi Gabor
>
> Thanks for th
e lapply to plot the
> data (or whatever) and be able to slap a label on it so I can keep track
> of what I am doing.
>
> Regards
>
> John Seers
>
>
>
>
> -Original Message-
> From: Gabor Grothendieck [mailto:[EMAIL PROTECTED]
> Sent: 05 February 2008
plot the
data (or whatever) and be able to slap a label on it so I can keep track
of what I am doing.
Regards
John Seers
-Original Message-
From: Gabor Grothendieck [mailto:[EMAIL PROTECTED]
Sent: 05 February 2008 16:17
To: john seers (IFR)
Cc: R Help
Subject: Re: [R] Using lapply and
9
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
http://www.student.kuleuven.be/~m0390867/dimitris.htm
- Original Message -
From: "john seers (IFR)" <[EMAIL PROTECTED]>
To: "R Help" <[EMAIL PROTECTED]>
Sent: Tuesday, February 05, 2008 5:05
The problem is your data is in wide format and you want it in long format.
See ?reshape and also see the reshape package. In your example, ?stack
is sufficient:
library(lattice)
xyplot(values ~ seq_along(values) | ind, data = stack(people))
On Feb 5, 2008 11:05 AM, john seers (IFR) <[EMAIL PRO
Hello All
Using lapply and ending up with lists of lists I often end up in the
position of not having the names of the list passed by lapply. So, if I
am doing something like a plot, and I would like the title to reflect
which plot it is, I cannot easily do it. So I find myself doing some
unstru
6 matches
Mail list logo