Trickier, but shorter:
> lapply(u,'[',1)
$a
[1] 1
$b
[1] "a"
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Fri, Jan 17, 2020 at 10:04 PM Eric Berger wrote:
Or simply
lapply(u, "[", 1)
$a
[1] 1
$b
[1] "a"
Cheers
Petr
> -Original Message-
> From: R-help On Behalf Of Eric Berger
> Sent: Thursday, January 16, 2020 1:36 PM
> To: R mailing list
> Subject: [R] Fwd: Extracting a particular column from list
>
> [Putting back onto r-help]
>
> Yo
2 matches
Mail list logo