auk_select {auk} | R Documentation |
Select a subset of columns
Description
Select a subset of columns from the eBird Basic Dataset (EBD) or the sampling events file. Subsetting the columns can significantly decrease file size.
Usage
auk_select(x, select, file, sep = "\t", overwrite = FALSE)
Arguments
x |
|
select |
character; a character vector specifying the names of the
columns to select. Columns should be as they appear in the header of the
EBD; however, names are not case sensitive and spaces may be replaced by
underscores, e.g. |
file |
character; output file. |
sep |
character; the input field separator, the eBird file is tab separated by default. Must only be a single character and space delimited is not allowed since spaces appear in many of the fields. |
overwrite |
logical; overwrite output file if it already exists |
Value
Invisibly returns the filename of the output file.
See Also
Other text:
auk_clean()
,
auk_split()
Examples
## Not run:
# select a minimal set of columns
out_file <- tempfile()
ebd <- auk_ebd(system.file("extdata/ebd-sample.txt", package = "auk"))
cols <- c("latitude", "longitude",
"group identifier", "sampling event identifier",
"scientific name", "observation count",
"observer_id")
selected <- auk_select(ebd, select = cols, file = out_file)
str(read_ebd(selected))
## End(Not run)