format_covariates: Format habitat covariate matrix

View source: R/deprecated.R

format_covariatesR Documentation

Format habitat covariate matrix

Description

format_covariates formats an array used by Data_Fn for habitat (a.k.a. density) covariates

Usage

format_covariates(
  Lat_e,
  Lon_e,
  t_e,
  Cov_ep,
  Extrapolation_List,
  Spatial_List,
  FUN = mean,
  Year_Set = min(t_e):max(t_e),
  na.omit = "error"
)

Arguments

Lat_e,

Latitude for covariate sample e

Lon_e,

Longitude for covariate sample e

t_e,

Time (e.g., year) for covariate sample e

Cov_ep,

matrix of covariates

Spatial_List,

Output from FishStatsUtils::Spatial_Information_Fn, representing spatial location of knots

FUN,

function used to aggregate observations associated with each knot-time combination

Year_Set,

Set of times t_e used when generating Cov_xtp

na.omit,

What to do when some knot-time combination has no observation. Options include "error" which throw an error, or "time-average" which fills in the average for other years with observations for each knot

Value

Tagged list of useful output

Cov_xtp

3-dimensional array for use in VAST::Data_Fn

var_p

a matrix summarizing the data-level variance, variance among knots, and lost variance when aggregating from data to knots for each covariate


James-Thorson/FishStatsUtils documentation built on Feb. 6, 2024, 4:26 a.m.