Learn R Programming

enmSdmX (version 1.2.12)

decimalToDms: Convert geographic coordinates in decimal format to degrees-minutes-second

Description

This function converts geographic coordinates in decimal format to degrees-minutes-seconds (DD-MM-SS) format.

Usage

decimalToDms(x)

Value

A numeric matrix with three columns: degrees, seconds, and seconds. Note that the hemisphere (i.e., indicated by the sign of x) is not returned since it could be either north/south or east/west.

Arguments

x

Numeric or vector of numeric values, longitude or latitude in decimal format.

Examples

Run this code

decimalToDms(38.56123) # latitude of St. Louis, Missouri, USA
decimalToDms(90.06521) # longitude of St. Louis, Missouri, USA

Run the code above in your browser using DataLab