Last data update: 2014.03.03

R: Generate a location object
setLocationR Documentation

Generate a location object

Description

Construct an object that contains a geographical location given by the latitude, longitude, and (optionally), the longitude of the nearest timezone border. This object is required in setMet.

If the longitude of the nearest time zone border (tzlong) is not set, it is assumed that all times are in 'local apparent time' (LAT), where maximum solar altitude is reached at noon. If it is set, it is used to calculate the time offset between clock time and solar time.

If lat and long are not given, a location can be selected from a simple map of the world. The maps package is needed for this utility.

You can also plot the location on a map of the world (see Examples).

Usage

setLocation(lat = NA, long = 0, tzlong = NA)

Arguments

lat

Latitude (degrees, southern hemisphere negative)

long

Longitue (degrees)

tzlong

Optional. Longitude of the nearest timezone border (degrees).

Value

An object of class yplocation.

Author(s)

Remko Duursma

See Also

setMet

Examples



# Set a location:
sydney <- setLocation(lat=-33.5, long=152, tzlong=150)

## Not run: 
# Set a location from a map:
somewhere <- setLocation()

# Plot locations
plot(sydney)

## End(Not run)

Results