rm.cols.Hst.ls: Remove Space-Time Covariates from Model

Description Usage Arguments Value Examples

View source: R/rm.cols.Hst.ls.R

Description

Remove spacial covariates from space-time covariate list

Usage

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

Arguments

Hst.ls

Space-time covariates (of supporting sites). A list of length τ, 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 τ, each element will be a numeric n x p_st - p_rm matrix, where p_rm is the length of rm.col.ndx.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
	
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)
  }

widals documentation built on Dec. 8, 2019, 1:07 a.m.