cleaner: Function to clean a data frame of eBird observations

Description Usage Arguments Details Value References Examples

Description

Filter eBird records to only those that meet a specified set of criteria.

Usage

1
cleaner(ebird.data, arguments, keep, group.id, unique.filter = TRUE, ...)

Arguments

ebird.data

Dataframe of eBird records.

arguments

Character vector of arguments to which the existing eBird records will be filtered. Records that match these arguments will be kept. Essentially this should be interpreted as a series of AND statements. In order to use OR statements, add the pipe to one of the comma-separated elements of the vector. See examples below.

keep

Character vector of column names in the existing eBird records that you would like to be passed along/kept in the cleaned files. Can be set to 'keep.all' in order to keep all columns.

group.id

The name of the group ID column in the existing eBird records. Usually (always?) simply 'GROUP.ID'. Required if you would like to remove all but one duplicated group checklist.

unique.filter

Whether or not to invoke the uniqueFilter function. Default is TRUE, meaning that all but one checklist from shared group checklists will be removed. Setting to FALSE means that all (duplicated) group checklists will be kept.

...

Additional arguments to be passed to lower level functions. For instance, could be used to pass sub.id information to uniqueFilter().

Details

This function should be fairly flexible. Pass it a set of arguments, and only records that meet those requirements will be kept. Tell it which columns you want to come along, and only those columns will be kept. Use the names of your data frame to keep all columns in the cleaned data frame. If you want to clean a number of different eBird data frames with the same set of arguments, consider using the multiCleaner function, which saves the results directly to file.

Value

A cleaned data frame of eBird records.

References

Team eBird.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(ex)
dim(ex)

#run the cleaner function
cleaned <- cleaner(ebird.data=ex, arguments=c("VALID == '1'",
"PROTOCOL_NAME == 'eBird - Stationary Count' |
  PROTOCOL_NAME == 'eBird - Traveling Count' & EFFORT_DISTANCE_KM <= 5 |
  PROTOCOL_NAME == 'PriMig - Pri Mig Banding Protocol' |
  PROTOCOL_NAME == 'eBird - Exhaustive Area Count' & DURATION_HRS < 10"),
  keep=names(ex), unique.filter=TRUE)

#many of the records were culled.
dim(cleaned)

eliotmiller/ebirdr documentation built on May 14, 2019, 10:33 a.m.