Description Usage Arguments Details Examples
Given a list of geographic coordinates, first tests the coordinates for out of bounds values and missing values. Then transforms the longitude from (0, 360) to (-180, +180) degrees, considering 6 significative digits.
1 2 3 4 5 | ## If there are the coordinates data frame
get_lon180(coords)
##
## If there are the coordinates text file
get_lon180(coords = NULL)
|
coords |
data frame with the geographic coordinates in decimal degrees, the longitude in the first column, the latitude in the second column and the column names: lon | lat (other columns can exist, however are unnecessary for this function). |
Input:
A text file without header with the geographic coordinates in decimal degrees: the longitude in the first column and the latitude in the second column, separated by tabs (other columns could exist, however are unnecessary for this function). Missing values must be codified as 'NA' in all fields.
Or a data frame with that same format and the column names: lon | lat.
Output:
A text file named 'coords_lon180' with three columns id | lon | lat, where: 'id' is the row identifier for the coordinates in the original list of coordinates, 'lon' is the longitude in the range (-180, +180) and 'lat' is the latitude. Both coordinates are in decimal degrees.
If there are errors, the function writes a text file with the coordinate pairs containing at least one coordinate out of bounds.
If there are missing coordinates, the function writes a text file with the coordinate pairs containing at least one missing coordinate.
A .RData file with the output data frame(s) that has/have the column
names: id | lon | lat. The data frame 'coords_lon180' can
be used as input parameter of get_country
to determine the
country names. Eventually is created the data frame 'excl_coords'
with the erroneous and/or missing coordinates.
1 2 3 4 | ## Not run:
get_lon180(coords = ispd)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.