Skip to contents

Check that data contains the columns required to fit the Macrocystis pyrifera wet/dry model, with appropriate types and values.

Usage

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

Arguments

data

A data frame of wet/dry observations, one row per sample.

x_name

A string naming the data for error messages.

Value

data, invisibly.

Details

Each row is one tissue sample. Required columns:

  • wet_mass_g, the mass of the tissue sample before drying (g, > 0).

  • dry_mass_g, the mass of the tissue sample after drying (g, > 0 and < wet_mass_g).

Other columns are ignored.

A warning gives the number of samples whose dry:wet ratio falls outside 0.02 to 0.50, the plausible range for kelp tissue; they are kept.

Examples

data <- data.frame(wet_mass_g = c(1.8, 4.6), dry_mass_g = c(0.22, 0.57))
kb_check_data_wetdry_macro(data)