Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

DMS-class

Class "DMS" for degree, minute, decimal second values


Description

The class provides a container for coordinates stored as degree, minute, decimal second values.

Objects from the Class

Objects can be created by calls of the form new("DMS", ...), converted from decimal degrees using dd2dms(), or converted from character strings using char2dms().

Slots

WS:

Object of class "logical" TRUE if input value negative

deg:

Object of class "numeric" degrees

min:

Object of class "numeric" minutes

sec:

Object of class "numeric" decimal seconds

NS:

Object of class "logical" TRUE if input value is a Northing

Methods

coerce

signature(from = "DMS", to = "numeric"): convert to decimal degrees

show

signature(object = "DMS"): print data values

Author(s)

Roger Bivand Roger.Bivand@nhh.no

See Also

Examples

data(state)
dd2dms(state.center$x)
dd2dms(state.center$y, NS=TRUE)
as.numeric(dd2dms(state.center$y))
as(dd2dms(state.center$y, NS=TRUE), "numeric")
as.numeric.DMS(dd2dms(state.center$y))
state.center$y

sp

Classes and Methods for Spatial Data

v1.4-5
GPL (>= 2)
Authors
Edzer Pebesma [aut, cre], Roger Bivand [aut], Barry Rowlingson [ctb], Virgilio Gomez-Rubio [ctb], Robert Hijmans [ctb], Michael Sumner [ctb], Don MacQueen [ctb], Jim Lemon [ctb], Finn Lindgren [ctb], Josh O'Brien [ctb], Joseph O'Rourke [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.