Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/coordinate_conversions.R
The function converts coordinates in various formats in a single column to 2 columns, decimal degrees North East. Use UTF-8 encoding to read and modify the code of the function
1 2 3 4 5 6 | coordinate_cleaning(
coords,
id,
assume_good_order = TRUE,
result_format = "complete"
)
|
coords |
a character vector containing longitude and latitude together. Either in sexadecimal or decimal degrees, latitude or longitude first, with or without a letter indicateing Northing and Easting. |
id |
a character of factor vector grouping coordinates belonging to the same study or article ie. coordinates sharing the same style, |
assume_good_order |
If there is no information (a letter indicating Northing and
Easting), latitude is assumed to come before longitude. Default to |
result_format |
If |
The function uses regular expressions and parsing to split latitude
and longitude values using different cues and prepares the coordinate strings
to go through dmsparse
. If coordinates are in a consistent
format, dmsparse
or dmsparsefmt
can be used.
If Latitude and Longitude are in different columns but format is messy, parse_lon_lat
does the job too.
data.frame. If result_format == 'simple'
: two columns, x and y
with coordinates in decimal degrees East and North. If result_format == 'complete'
, coordinates are given
with comments on errors found in initial values.
Alban Sagouis
dmsabs
, dmsparse
,
quickclean
, errorcheck
, CoordinateCleaner
.
parse_lon_lat
1 2 3 4 | load("data/coordinates_test_dataset_1")
coords <- dat$coord
id <- dat$study_ID
data.frame(dat, coordinate_cleaning(coords, id))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.