Read an eBird Basic Dataset file using readr::read_delim()
. read_ebd()
reads the EBD itself, while read_sampling()` reads a sampling event data
file.
read_ebd(x, sep = "\t", unique = TRUE, rollup = TRUE)# S3 method for character
read_ebd(x, sep = "\t", unique = TRUE, rollup = TRUE)
# S3 method for auk_ebd
read_ebd(x, sep = "\t", unique = TRUE, rollup = TRUE)
read_sampling(x, sep = "\t", unique = TRUE)
# S3 method for character
read_sampling(x, sep = "\t", unique = TRUE)
# S3 method for auk_ebd
read_sampling(x, sep = "\t", unique = TRUE)
# S3 method for auk_sampling
read_sampling(x, sep = "\t", unique = TRUE)
A data frame of EBD observations. An additional column,
checklist_id
, is added to output files if unique = TRUE
, that uniquely
identifies the checklist from which the observation came. This field is
equal to sampling_event_identifier
for non-group checklists, and
group_identifier
for group checklists.
filename or auk_ebd
object with associated output
files as created by auk_filter()
.
character; single character used to separate fields within a row.
logical; should duplicate grouped checklists be removed. If
unique = TRUE
, auk_unique()
is called on the EBD before returning.
logical; should taxonomic rollup to species level be applied.
If rollup = TRUE
, auk_rollup()
is called on the EBD before returning.
Note that this process can be time consuming for large files, try turning
rollup off if reading is taking too long.
read_ebd(character)
: Filename of EBD.
read_ebd(auk_ebd)
: auk_ebd
object output from auk_filter()
read_sampling(character)
: Filename of sampling event data file
read_sampling(auk_ebd)
: auk_ebd
object output from auk_filter()
. Must have
had a sampling event data file set in the original call to auk_ebd()
.
read_sampling(auk_sampling)
: auk_sampling
object output from auk_filter()
.
This functions performs the following processing steps:
Data types for columns are manually set based on column names used in the February 2017 EBD. If variables are added or names are changed in later releases, any new variables will have data types inferred by the import function used.
Variables names are converted to snake_case
.
Duplicate observations resulting from group checklists are removed using
auk_unique()
, unless unique = FALSE
.
Other import:
auk_zerofill()
f <- system.file("extdata/ebd-sample.txt", package = "auk")
read_ebd(f)
# read a sampling event data file
x <- system.file("extdata/zerofill-ex_sampling.txt", package = "auk") %>%
read_sampling()
Run the code above in your browser using DataLab