bbs_route_unique: Identify survey-wide unique BBS routes from a BBS table

Description Usage Arguments Details Value Author(s) References Examples

Description

The route column in a variety of BBS tables only identifies unique routes within states. This function creates route identifiers that are unique survey-wide by pasting together columns country_num, state_num, and route (after first adding leading zeros to ensure a constant number of digits for each component column).

Usage

1

Arguments

df

A data.frame created by a bbs_* function that includes columns country_num, state_num, and route.

Details

Before the component columns are pasted together and reconverted to an integer, leading zeros are added, where necessary, to ensure constant columns widths (and therefore unique final codes). The number of digits for each component column is: - country_num: 3 digits - state_num: 2 digits - route: 3 digits

Value

An integer vector identifying unique routes survey-wide.

Author(s)

Bob O'Hara

Patrick Barks <patrick.barks@gmail.com>

References

Pardieck, K.L., D.J. Ziolkowski Jr., M. Lutmerding and M.-A.R. Hudson. 2018. North American Breeding Bird Survey Dataset 1966-2017, version 2017.0. U.S. Geological Survey, Patuxent Wildlife Research Center. https://doi.org/10.5066/F76972V8

Examples

1
2
3
4
5
6
7
8
9
## Not run: 

# load the metadata table 'weather'
weather <- bbs_meta_weather(bbs_dir = ".")

# add a column identifying unique routes
weather$route_unique <- bbs_route_unique(weather)

## End(Not run)

patrickbarks/bbs documentation built on May 28, 2019, 12:34 a.m.