R/design_matrix.s1_return.R

Defines functions design_matrix.s1_return

#Helper function that overrides response variable with non-NA (e.g. 1) so that the returned design.matrix for all of s1 is returned

#returns design matrix for s1 with complete.obs for auxiliary variables
design_matrix.s1_return <- function(formula, data){
  data[,all.vars(formula)[1]] <- 1 #change response values non-NA to trick lm function
  model.matrix(formula, data=data)}

Try the forestinventory package in your browser

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

forestinventory documentation built on Jan. 13, 2021, 9:11 p.m.