Learn R Programming

hzar (version 0.2-5)

hzar.map.latLong.dms: Convert D-M-S C strings to degrees

Description

Translate a character vector of typical map coordinate(s) to a matrix of numeric values.

Usage

hzar.map.latLong.dms(coordinates)

Arguments

coordinates
A character vector, with each string containing one or more latitude / longitude measurements, seperated by the cardinal direction of the measurement (N/S for latitude, E/W for longitude).

Value

  • A NxM matrix of numeric values, where N is the number of strings in coordinates and M is the greatest number of measurements in a single string. Each row contains the measurements from each string in coordinates, filling one column from left to right for each measurement. The remaining columns (if any) in a row have the value NA.

See Also

hzar.map.dms2deg

Examples

Run this code
# A single value:
hzar.map.latLong.dms(c("9-52 N"))
# A 1:2 matrix:
hzar.map.latLong.dms(c("9-52 N 82 W"))
# A 2:2 matrix with NA for the upper right corner:
hzar.map.latLong.dms(c("9-52-34 E" ,"9-52 N 82 W"))

Run the code above in your browser using DataLab