# \donttest{
if(requireNamespace("rnaturalearthdata")){
database_id <- c(1, 2, 3, 4)
scientificName <- c(
"Rhinella major", "Scinax ruber",
"Siparuna guianensis", "Psychotria vellosiana"
)
decimalLatitude <- c(63.43333, -14.43333, -41.90000, -46.69778)
decimalLongitude <- c(-17.90000, -67.91667, -13.25000, -13.82444)
country <- c("BOLIVIA", "bolivia", "Brasil", "Brazil")
x <- data.frame(
database_id, scientificName, decimalLatitude,
decimalLongitude, country
)
# Get country codes
x <- bdc::bdc_country_standardized(data = x, country = "country")
jbd_coordinates_transposed(
data = x,
idcol = "database_id",
sci_names = "scientificName",
lat = "decimalLatitude",
lon = "decimalLongitude",
country = "country_suggested",
countryCode = "countryCode",
border_buffer = 0.2,
save_outputs = FALSE,
scale = "medium"
)
}
# } # END if require
Run the code above in your browser using DataLab