Read an eBird Basic Dataset (EBD) file, and associated sampling event data file, to produce a zero-filled, presence-absence dataset. The EBD contains bird sightings and the sampling event data is a set of all checklists, they can be combined to infer absence data by assuming any species not reported on a checklist was had a count of zero.
auk_zerofill(x, ...) # S3 method for data.frame auk_zerofill( x, sampling_events, species, taxonomy_version, collapse = FALSE, unique = TRUE, rollup = TRUE, drop_higher = TRUE, complete = TRUE, ... ) # S3 method for character auk_zerofill( x, sampling_events, species, taxonomy_version, collapse = FALSE, unique = TRUE, rollup = TRUE, drop_higher = TRUE, complete = TRUE, sep = "\t", ... ) # S3 method for auk_ebd auk_zerofill( x, species, taxonomy_version, collapse = FALSE, unique = TRUE, rollup = TRUE, drop_higher = TRUE, complete = TRUE, sep = "\t", ... ) collapse_zerofill(x)
additional arguments passed to methods.
character; species to include in zero-filled dataset, provided as scientific or English common names, or a mixture of both. These names must match the official eBird Taxomony (ebird_taxonomy). To include all species, leave this argument blank.
integer; the version (i.e. year) of the taxonomy. In
most cases, this should be left empty to use the version of the taxonomy
included in the package. See
logical; whether to call
logical; whether to remove taxa above species during the
rollup process, e.g. "spuhs" like "duck sp.". See
character; single character used to separate fields within a row.
By default, an
auk_zerofill object, or a data frame if
collapse = TRUE.
auk_zerofill() generates an
auk_zerofill object consisting of a list with
observations is a data frame
giving counts and binary presence/absence data for each species.
sampling_events is a data frame with checklist level information. The two
data frames can be connected via the
checklist_id field. This format is
efficient for storage since the checklist columns are not duplicated for each
species, however, working with the data often requires joining the two data
To return a data frame, set
collapse = TRUE. Alternatively,
zerofill_collapse() generates a data frame from an
by joining the two data frames together to produce a single data frame in
which each row provides both checklist and species information for a
The list of species is checked against the eBird taxonomy for validity. This
taxonomy is updated once a year in August. The
auk package includes a copy
of the eBird taxonomy, current at the time of release; however, if the EBD
auk versions are not aligned, you may need to explicitly specify which
version of the taxonomy to use, in which case the eBird API will be queried
to get the correct version of the taxonomy.
data.frame: EBD data frame.
character: Filename of EBD.
# read and zero-fill the ebd data f_ebd <- system.file("extdata/zerofill-ex_ebd.txt", package = "auk") f_smpl <- system.file("extdata/zerofill-ex_sampling.txt", package = "auk") auk_zerofill(x = f_ebd, sampling_events = f_smpl)#> Zero-filled EBD: 619 unique checklists, for 3 species.# use the species argument to only include a subset of species auk_zerofill(x = f_ebd, sampling_events = f_smpl, species = "Collared Kingfisher")#> Zero-filled EBD: 619 unique checklists, for 1 species.# to return a data frame use collapse = TRUE ebd_df <- auk_zerofill(x = f_ebd, sampling_events = f_smpl, collapse = TRUE)