filter_odkc_turtledata: Filter odkc_data to a given area_name.

View source: R/filter_odkc_turtledata.R

filter_odkc_turtledataR Documentation

Filter odkc_data to a given area_name.

Description

Filter odkc_data to a given area_name.

Usage

filter_odkc_turtledata(
  data,
  area_name = NULL,
  username = NULL,
  verbose = wastdr::get_wastdr_verbose()
)

Arguments

data

(list) The output of data("odkc_data"), a list of tibbles and sf

area_name

(chr) The name of the area to filter the data by. Options:

  • NULL (default): do not filter data, return unfiltered data.

  • "All turtle programs": do not filter data, return unfiltered data.

  • "Other": Filter data to area_name NA.

  • Any name in unique(odkc_data$areas$area_name): return data filtered to this area_name.

username

(chr) The ODK Collect username to filter the data by. This is handy to investigate where and when a particular name was used. Default: NULL

verbose

Whether to show debug messages. Default: wastdr::get_wastdr_verbose()

Value

(list) The input data, optionally filtered to a subset of records.

See Also

Other odkc: add_hatching_emergence_success_odkc(), add_nest_labels_odkc(), download_odkc_turtledata_2020(), exclude_training_species_odkc(), general_disturbance_by_season_odkc(), hatching_emergence_success_odkc(), map_dist_odkc(), map_mwi_odkc(), map_sv_odkc(), map_tracks_odkc(), map_tt_odkc(), nest_disturbance_by_season_odkc(), nesting_type_by_area_season_age_species_odkc(), nesting_type_by_area_season_species_odkc(), nesting_type_by_season_age_species_odkc(), nesting_type_by_season_calendarday_age_species_odkc(), nesting_type_by_season_calendarday_species_odkc(), nesting_type_by_season_day_species_odkc(), nesting_type_by_season_species_odkc(), nesting_type_by_season_week_age_species_odkc(), nesting_type_by_season_week_site_species_odkc(), nesting_type_by_season_week_species_odkc(), nesting_type_by_site_season_age_species_odkc(), nesting_type_by_site_season_species_odkc()

Examples

data(odkc_data)

# All data
data_all <- filter_odkc_turtledata(odkc_data)
nrow(data_all$tracks)

# One area
area_names <- unique(odkc_data$areas$area_name)
area_names
data_area_1 <- filter_odkc_turtledata(odkc_data, area_name = "Cape Dommett")
nrow(data_area_1$tracks)
data_area_2 <- filter_odkc_turtledata(odkc_data, area_name = area_names[[2]])
nrow(data_area_2$tracks)


# Orphans
data_orphans <- filter_odkc_turtledata(odkc_data, area_name = "Other")
nrow(data_orphans)

parksandwildlife/wastdr documentation built on Nov. 17, 2022, 4:52 p.m.