parzer
parzer copied to clipboard
Parse geographic coordinates
parzer
parzer parses messy geographic coordinates
Docs: https://docs.ropensci.org/parzer/
You may get data from a published study or a colleague, and the coordinates may be in some messy character format that you’d like to clean up to have all decimal degree numeric data.
parzer API:
parse_hemisphereparse_latparse_llstrparse_lonparse_lon_latparse_parts_latparse_parts_lonpz_dpz_degreepz_mpz_minutepz_spz_second
Usage
For example, parse latitude and longitude from messy character vectors.
parse_lat(c("45N54.2356", "-45.98739874", "40.123°"))
#> [1] 45.90393 -45.98740 40.12300
parse_lon(c("45W54.2356", "-45.98739874", "40.123°"))
#> [1] -45.90393 -45.98740 40.12300
See more in the Introduction to the parzer package
vignette.
Installation
Stable version
install.packages("parzer")
Development version
remotes::install_github("ropensci/parzer")
library("parzer")
Similar art
sp::char2dms: is most similar toparzer::parse_latandparzer::parse_lon. However, withsp::char2dmsyou have to specify the termination character for each of degree, minutes and seconds.parzerdoes this for the user.biogeo::dms2dd: very unlike functions in this package. You must pass separate degrees, minutes, seconds and direction todms2dd. No exact analog is found inparzer, whose main focus is parsing messy geographic coordinates in strings to a more machine readable version
Meta
- Please report any issues or bugs.
- License: MIT
- Get citation information for
parzerin R doingcitation(package = 'parzer') - Please note that this package is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
