-
Notifications
You must be signed in to change notification settings - Fork 0
/
2_rgbif.R
42 lines (31 loc) · 1.09 KB
/
2_rgbif.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
install.packages("rgbif")
install.packages("remotes")
remotes::install_github("ropensci/CoordinateCleaner")
library(rgbif)
library(CoordinateCleaner)
species <- "Tapirus terrestris"
tapirus <- occ_search(scientificName = species,
basisOfRecord = "PRESERVED_SPECIMEN",
limit = 10000)
class(tapirus)
names(tapirus)
head(tapirus$data)
dim(tapirus$data)
data_tapirus <- tapirus$data
table(data_tapirus$taxonomicStatus)
unique(data_tapirus$scientificName)
table(data_tapirus$scientificName, data_tapirus$taxonomicStatus)
#data_tapirus[linhas, colunas]
data_tapirus[, c("scientificName", "acceptedScientificName")] %>% unique()
#
names(data_tapirus)
data_tapirus[, c("decimalLatitude", "decimalLongitude")]
tem_coordenada <- complete.cases(data_tapirus[, c("decimalLatitude", "decimalLongitude")])
coord_tapirus <- data_tapirus[ tem_coordenada , ]
clean <- clean_coordinates(x = coord_tapirus,
lon = "decimalLongitude",
lat = "decimalLatitude",
species = "acceptedScientificName"
)
clean
coord_tapirus[clean$.summary, ]