R/append_inat.R
append_inat.RdThe function tidies and cleans downloaded spotted lanternfly data from iNaturalist's export page and appends it to `lyde`.
append_inat(path, established_states = TRUE, round = TRUE)A character string that is the path to the csv file containing the downloaded iNaturalist data.
Filters out inat observations in states that don't have confirmed establishments yet.
(logical) If TRUE, the latitude and longitude columns will have been rounded to the 1k grid. If FALSE, the coordinates will be raw, directly from iNaturalist.
A cleaned tibble
This should be applied to a dataset downloaded through the link: `https://www.inaturalist.org/observations/export`
Or for the direct search query: `https://www.inaturalist.org/observations/export?search_on=names&quality_grade=research&identifications=most_agree&captive=false&place_id=1&taxon_id=324726`
if (FALSE) { # \dontrun{
# return lyde with iNaturalist observations with the raw latitude/longitude coordinates
df <- append_inat("observations-686514.csv", round = FALSE)
# return lyde with iNaturalist observations with the latitude/longitude coordinates rounded to the 1km grid
df <- append_inat("observations-686514.csv", round = TRUE)
} # }