R/get_predlist.R

Defines functions get_predlist

Documented in get_predlist

#' Get list of stepwise predictors from a reconstruction matrix
#'
#' This creates a list of available predictors along the years in 
#' the reconstruction matrix.
#'
#' @param reconstruction.matrix A matrix of predictors for a reconstruction.
#' Columns are predictors, rows are years.
#' @return A matrix of unique combinations of predictors through time.
get_predlist <- function(reconstruction.matrix){
  reconstruction.matrix.present <- !is.na(reconstruction.matrix)
  # reconstruction.matrix.present[!reconstruction.matrix.present] <- NA
  reconstruction.matrix.present <- unique(reconstruction.matrix.present)

  return(reconstruction.matrix.present)
}
bocinsky/paleocar documentation built on June 2, 2024, 4:12 a.m.