Skip to contents

Check that data has the columns and values needed to fit the Macrocystis pyrifera cover calibration model.

Usage

kb_check_data_cover_calibration_macro(
  data,
  x_name = chk::deparse_backtick_chk(substitute(data))
)

Arguments

data

A data frame of in situ survey biomass, one row per survey.

x_name

A string naming the data for error messages.

Value

data, invisibly.

Details

data is the output of kb_predict_biomass_in_situ(), one row per in situ survey. Required columns:

  • biomass_kg_m2, the draws of the survey's wet biomass per m² (kg/m², >= 0).

  • site, the site surveyed (any text).

  • year, the year of the survey (whole number or text).

  • plot_area_m2, the area of the plot polygon bounding the survey area that the canopy cover is measured over (m², > 0, or missing).

  • canopy_area_m2, the canopy area delineated within the plot polygon (m², >= 0 and <= plot_area_m2, or missing).

  • canopy_tide_height_m, the tide height when the canopy was imaged, relative to chart datum (m, any number, or missing).

Other columns are ignored.

The plot cover columns are given or missing together; a row without them is not fitted.

Examples

biomass <- kb_predict_biomass_in_situ(
  fit_weight_sim_macro,
  data_size_census_sim_macro,
  data_survey_in_situ_sim_macro,
  progress = "none"
)
kb_check_data_cover_calibration_macro(biomass)