Select objects by their position.

Share:

Description

This function select objects by their position specified by index.

Usage

1
selectByIndex(index, ...)

Arguments

index

a numeric value or vector specifying position.

...

an arbitrary number of objects to be selected.

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.

Value

a selected object or a list of selected objects.

See Also

getIndex, epifit

Examples

1
2
3
4
5
6
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)