Learn R Programming

biogeo (version 1.0)

parsecoords: Parse coordinates into separate fields

Description

Parse coordinates into separate fields from a character vector using a format string. This is a manual version of dmsparse.

Usage

parsecoords(dat, d1, fmtstr)

Arguments

dat
a character vector of coordinates
d1
a summary of the various coordinate formats obtained from uniqueformats
fmtstr
a format string for the different formats present e.g. "dd.mm","dd.mm.ss"

Value

See Also

dmsparse, uniqueformats

Examples

Run this code
fmtstr<-c("dd mm.m","dd mm ss.ss","dd mm ss") 
uf<-uniqueformats(places$long[1:3])
px<-parsecoords(places$long[1:3],uf,fmtstr) 

Run the code above in your browser using DataLab