subset.list | R Documentation |
list
that contains a subset of the components of the supplied
list
.Select components of a list
specified by a list of numbers or names,
or by a logical indicating for each component of the list whether or not it is to
be retained.
## S3 method for class 'list' subset(x, select = 1:length(x), ...)
x |
An |
select |
A |
... |
further arguments passed to or from other methods. Not used at present. |
A list
with just the subset of the components from x
. If the
components of x
are named, then these names are retained in the subset
list
.
Chris Brien
subset.alldiffs
x <- list(1:3,letters[1:3],LETTERS[1:3]) y <- subset.list(x, select = c(1,3)) y <- subset.list(x, select = c(TRUE,FALSE,TRUE)) names(x) <- LETTERS[1:3] y <- subset.list(x, select = c(1,3)) z <- subset.list(x, select = LETTERS[c(1,3)]) x <- list(1:3,letters[1:3],LETTERS[1:3]) names(x)[c(1,3)] <- LETTERS[c(1,3)] z <- subset.list(x, select = c(1,2)) v <- subset.list(x)