View source: R/add_missing_zeros.R
add_missing_zeros | R Documentation |
add_missing_zeros
takes a compressed ‘long-form' data frame, and adds rows for samples that were conducted but didn’t catch any of a given fish species
add_missing_zeros(data_frame, unique_sample_ID_colname, sample_colname,
species_colname, species_subset = NULL, Method = "Slow",
if_multiple_records = "Error", verbose = TRUE, save_name = NULL,
error_tol = 1e-12)
data_frame |
data frame containing data that missing zeros |
unique_sample_ID_colname |
column name from 'data_frame' that gives a unique ID for each sample (where rows with the same unique ID are different species from the same sample) |
sample_colname |
column name from 'data_frame' for sample of each species (e.g., representing catch in weight) |
species_colname |
column name from 'data_frame' identifying species sampled for each row |
species_subset |
character vector giving levels of 'species_colname' that should be retained (representing which species to keep); if NULL, then |
Method |
whether to use fast or slow method (fast may be more robust, and has more options for multiple_records) |
if_multiple_records |
What to do if multiple rows have the same vales for |
verbose |
Boolean, whether to print output to screen |
save_name |
optional directory for saving result locally |
error_tol |
value used in checking that final biomass matches original biomass (if |
A data frame with number of rows equal to number of unique samples times number of species
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.