subsetsites.Hst.ls {widals} | R Documentation |
Site-Wise Extract Space-Time Covariates
Description
Extract space-time covariates by site
Usage
subsetsites.Hst.ls(Hst.ls, xmask)
Arguments
Hst.ls |
Space-time covariates. A list of length |
xmask |
Which sites to remove from |
Value
Space-time covariates. A list of length \tau
, each element a c
x p_st
numeric matrix, where c
is the number of TRUE
's in boolean xmask
, or length of index xmask
.
Examples
tau <- 70
n <- 28
Hst.ls <- list()
for(i in 1:tau) { Hst.ls[[i]] <- matrix(rnorm(n*4), nrow=n) }
subsetsites.Hst.ls(Hst.ls, c(1,3,10))
subsetsites.Hst.ls(Hst.ls, c(TRUE, TRUE, rep(FALSE, n-2)))
## The function is currently defined as
function (Hst.ls, xmask)
{
tau <- length(Hst.ls)
Hst.ls.out <- list()
for (i in 1:tau) {
Hst.ls.out[[i]] <- Hst.ls[[i]][xmask, , drop = FALSE]
}
return(Hst.ls.out)
}
[Package widals version 0.6.1 Index]