Learn R Programming

epifit (version 0.1.2)

selectByIndex: Select objects by their position.

Description

This function select objects by their position specified by index.

Usage

selectByIndex(index, ...)

Arguments

index
a numeric value or vector specifying position.
...
an arbitrary number of objects to be selected.

Value

a selected object or a list of selected objects.

Details

This function select object by their position specified by index. When index is vector, a list of selected objects is returned. Main use of this function is to select time-specific covariate with getIndex function.

See Also

getIndex, epifit

Examples

Run this code
id <- 1:10
cov1 <- rnorm(10)
cov2 <- rbinom(10, 4, 0.5)
cov3 <- runif(10)
covset1 <- selectByIndex(c(1,2), id, cov1, cov2, cov3)
cov <- selectByIndex(3, id, cov1, cov2, cov3)

Run the code above in your browser using DataLab