NOT_CRAN <- identical(tolower(Sys.getenv("NOT_CRAN")), "true")
knitr::opts_chunk$set(
  comment = "#>",
  collapse = TRUE,
  warning = FALSE,
  message = FALSE,
  purl = NOT_CRAN,
  eval = NOT_CRAN
)

Project Status: Active – The project has reached a stable, usable state and is being actively developed. cran checks R-CMD-check rstudio mirror downloads cran version

codecov.io

parzer parses messy geographic coordinates

Docs: https://docs.ropensci.org/parzer/

You may get data from a published study or a colleague where the coordinates are in some messy character format that you'd like to clean up to get all decimal degree numeric data.

parzer API:

cat(paste(" -", paste(sprintf("`%s`", sort(getNamespaceExports("parzer"))), collapse = "\n - ")))

Usage

For example, parse latitude and longitude from messy character vectors.

library("parzer")
parse_lat(c("45N54.2356", "-45.98739874", "40.123°"))
parse_lon(c("45W54.2356", "-45.98739874", "40.123°"))

And you can even split and parse strings that contain latitude and longitude together.

parse_llstr(c("4 51'36\"S, 101 34'7\"W", "40.123°; 45W54.2356"))

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

Meta

ropensci_footer



ropenscilabs/parzer documentation built on March 12, 2023, 10:51 p.m.