Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

subset_hmatrix

Subsets hmatrix according to an index


Description

Subsets hmatrix according to an index

Usage

subset_hmatrix(x, index, compress = TRUE)

Arguments

x

hmatix object that should be subsetted

index

integer vector with (possibly duplicated) indices for each curve to select

compress

logical, defaults to TRUE. Only used to force a meaningful behaviour of applyFolds with hmatrix objects when using nested resampling.

Details

This methods is primary useful when subsetting repeatedly.

Examples

t1 <- rep((1:5)/2, each = 3)
id1 <- rep(1:3, 5)
x1 <- matrix(1:15, ncol = 5) 
s1 <- (1:5)/2 
hmat <- hmatrix(time = t1, id = id1, x = x1, argvals = s1, timeLab = "t1", 
                argvalsLab = "s1", xLab = "test")

index1 <- c(1, 1, 3)
index2 <- c(2, 3, 3)
resMat <- subset_hmatrix(hmat, index = index1)
try(resMat2 <- subset_hmatrix(resMat, index = index2))
resMat <- subset_hmatrix(hmat, index = index1, compress = FALSE)
try(resMat2 <- subset_hmatrix(resMat, index = index2))

FDboost

Boosting Functional Regression Models

v1.0-0
GPL-2
Authors
Sarah Brockhaus [aut], David Ruegamer [aut, cre], Almond Stoecker [aut], Torsten Hothorn [ctb], with contributions by many others (see inst/CONTRIBUTIONS) [ctb]
Initial release
2020-08-31

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.