Learn R Programming

ValidationExplorer (version 0.1.1)

mask_FE_all_visits: Mask a proportion of all visits: A function for simulating a fixed effort validation design.

Description

Mask a proportion of all visits: A function for simulating a fixed effort validation design.

Usage

mask_FE_all_visits(df, effort_prop, seed = NULL)

Value

A dataframe object that is a copy of the input df, but with the appropriate level of effort according to a fixed effort validation design.

Arguments

df

A dataframe object in the format of full_dfs output from simulate_validatedData

effort_prop

The proportion of recordings to be randomly sampled from the first visit for validation

seed

An optional random seed to make masking reproducible

Examples

Run this code
library(dplyr)

cd_data <- sim_dat()$full_df %>% tidyr::uncount(weights = count, .remove = FALSE)
FE_data <- mask_FE_all_visits(cd_data, effort_prop = 0.1)

head(cd_data)
head(FE_data)

FE_data %>% 
  group_by(site, visit) %>% 
  summarize(
    prop_validated = sum(!is.na(true_spp))/n()
  )

Run the code above in your browser using DataLab