rm.cols.Hst.ls {widals}R Documentation

Remove Space-Time Covariates from Model

Description

Remove spacial covariates from space-time covariate list

Usage

rm.cols.Hst.ls(Hst.ls, rm.col.ndx)

Arguments

Hst.ls

Space-time covariates (of supporting sites). A list of length \tau, each element should be a numeric n x p_st matrix.

rm.col.ndx

Which columns of Hst.ls to remove. A positive scalar integer.

Value

An unnamed list of length \tau, each element will be a numeric n x p_st - p_rm matrix, where p_rm is the length of rm.col.ndx.

Examples

	
tau <- 21
n <- 7
	
pst <- 5
Hst.ls <- list()
for(i in 1:tau) { Hst.ls[[i]] <- matrix(1:pst, n, pst, byrow=TRUE) }

rm.cols.Hst.ls(Hst.ls, c(1,3))


## The function is currently defined as
function (Hst.ls, rm.col.ndx) 
{
    tau <- length(Hst.ls)
    for (i in 1:tau) {
        Hst.ls[[i]] <- Hst.ls[[i]][, -rm.col.ndx, drop = FALSE]
    }
    return(Hst.ls)
  }

[Package widals version 0.6.1 Index]