inat_harvest: Harvest observations outside the USFWS National Wildlife...

Description Usage Arguments Value Examples

View source: R/inat_harvest.R

Description

Harvest observations outside the USFWS National Wildlife Refuge System iNaturalist project for a given property

Usage

1
2
3
inat_harvest(refuge = NULL,
  inat_proj = "usfws-national-wildlife-refuge-system", taxon_name = NULL,
  user = NULL, pw = NULL, interactive = TRUE)

Arguments

refuge

character string or vector indicating USFWS properties on which to harvest observations not associated with the USFWS National Wildlife Refuge System project ("usfws-national-wildlife-refuge-system"; http://www.inaturalist.org/projects/usfws-national-wildlife-refuge-system). It is strongly advised that this parameter result from running find_refuges to avoid potential mismatches. See Examples. By default (refuge = NULL), all USFWS properties with boundaries in iNaturalist are processed sequentially.

inat_proj

character scalar of an iNaturalist project to which observations will be added (harvested). This can be a character slug or group ID. Default is to harvest observations on the refuge properties to the the USFWS National Wildlife Refuge System project ("usfws-national-wildlife-refuge-system"; http://www.inaturalist.org/projects/usfws-national-wildlife-refuge-system).

taxon_name

character scalar. Retrieve only observations associated with taxon_name. This also retrieves descendant taxa. This can greatly reduce harvesting time, and may be most useful harvest to projects for specific taxa (e.g., harvesting only 'Apoidea' observations to a bee and wasp project). Note if taxon_name is ambiguous and matches multiple taxa, no observations may be retrieved.

user

character scalar of iNaturalist username or associated e-mail address

pw

character scalar of iNaturalist password

interactive

if TRUE, the default, the user is prompted to proceed prior to completing the harvest. Setting to FALSE proceeds with the harvest without prompting

Value

This function performs a series of POST operations to assign observations to the USFWS NWRS project via the iNaturalist API (???). As a side effect, it returns a data.frame of observations that failed to be assigned, if any.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
# Harvest to the default USFWS NWRS project
hn <- find_refuges("harris neck")
hn_harvest <- inat_harvest(hn, user = "YOUR_USER_NAME", pw = "YOUR_PASSWORD")

# Occasionally observations cannot be harvested because the user restricts their observations.
# If this happens, you will receive a message indicating how many records could not be harvested.
# If some records cannot be harvested, you can explore the reasons for these failures by
# "tabling" the error message column of the object you just created.
# Note that this only makes sense if you get a message about records not harvested
table(hn_harvest$error_msg)

# Harvest to the USFWS NWRS Bee and Wasp project
hn <- find_refuges("harris neck")
hn_harvest <- inat_harvest(hn, inat_proj = "usfws-national-wildlife-refuge-system-bees-wasps",
                           taxon_name = "Apoidea", user = "YOUR_USER_NAME", pw = "YOUR_PASSWORD")

## End(Not run)

adamdsmith/fwsinat documentation built on May 29, 2019, 2:10 p.m.