Skip to content
Back to formatted view

Raw Message

Message-ID: <4c554c49-9c44-4cdd-8bf0-c7a5592f398d@v29g2000prb.googlegroups.com>
Date: 2010-05-23T06:28:17Z
From: Kang Min
Subject: Selecting first 7 elements

Hi,

I have a list of 100, each list has 20 elements, and I would like to
select the first 7 elements in each list.
Let's take the alphabet as an example.

x <- lapply(1:100, function(i) sample(LETTERS))

I tried x[[1:7]], but it doesn't work. Can anyone enlighten me on how
to do such selections?

Thank you.

Kang Min