Given the coordinates of input points (in WGS84), the function
identifies the IDs of the regional units of the Hydrography90m in which the
points are located. Input is a point data frame. The regional units refer to
non-interrupted basins (as opposed to the 20°x20° tiles).
These IDs can then be used to download the Hydrography90m regional unit
raster mask(s) using download_tiles().
Arguments
- data
- a data.frame or data.table that contains the columns regarding the longitude / latitude coordinates in WGS84. 
- lon
- character. The name of the column with the longitude coordinates. 
- lat
- character. The name of the column with the latitude coordinates. 
- quiet
- logical. If FALSE, the standard output will be printed. Default is TRUE. 
Examples
# Download test data into the temporary R folder
# or define a different directory
my_directory <- tempdir()
download_test_data(my_directory)
# Read the species data
species_occurrence <- read.table(paste0(my_directory,
                                       "/hydrography90m_test_data",
                                       "/spdata_1264942.txt"),
                              header = TRUE)
# Get the regional unit ID
get_regional_unit_id(species_occurrence, lon = "longitude",
                    lat = "latitude")