subset.list {asremlPlus}R Documentation

Forms a list that contains a subset of the components of the supplied list.

Description

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.

Usage

## S3 method for class 'list'
subset(x, select = 1:length(x), ...)

Arguments

x

An list object.

select

A numeric or character that lists or names the components of the list x that are to be retained in the subset. It can also be a logical that is the same length as x and indicates whether or not a component is to be retained.

...

further arguments passed to or from other methods. Not used at present.

Value

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.

Author(s)

Chris Brien

See Also

subset.alldiffs

Examples

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)

[Package asremlPlus version 4.4.35 Index]