R/padzeros.R

Defines functions padzeros

Documented in padzeros

padzeros <- function(data, nzeros, side="both") {

if (is.vector(data)==TRUE) data <- t(as.matrix(data))

M.zeros <- matrix(0, nrow(data), nzeros)

newdata <- switch(side, 
	   both  = cbind(M.zeros, data, M.zeros),
	   left = cbind(M.zeros, data),
	   right   = cbind(data, M.zeros))

}

Try the ptw package in your browser

Any scripts or data that you put into this service are public.

ptw documentation built on Jan. 19, 2022, 5:07 p.m.