dmsToDecimal: Convert geographic coordinates in degrees-minutes-second to...

View source: R/dmsToDecimal.r

dmsToDecimalR Documentation

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

Description

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

Usage

dmsToDecimal(dd, mm, ss, hemis = NULL)

Arguments

dd

Numeric. Degrees longitude or latitude. Can be a decimal value.

mm

Numeric. Minutes longitude or latitude. Can be a decimal value.

ss

Numeric. Second longitude or latitude. Can be a decimal value.

hemis

Character or NULL (default). "N" (north), "S" (south), "E" (east), or "W" (west). If left as NULL, then the value returned will always be positive, even if it is in the western or southern hemisphere.

Value

Numeric.

Examples

dmsToDecimal(38, 37, 38) # latitude of St. Louis, Missouri, USA
dmsToDecimal(38, 37, 38, 'N') # latitude of St. Louis, Missouri, USA
dmsToDecimal(90, 11, 52.1) # longitude of St. Louis, Missouri, USA
dmsToDecimal(90, 11, 52.1, 'W') # longitude of St. Louis, Missouri, USA

adamlilith/enmSdm documentation built on Jan. 6, 2023, 11 a.m.