Learn R Programming

geo (version 1.4-3)

selpos: Geographical point selection.

Description

Select geographical data points by arbitrary criterion.

Usage

selpos(lat, lon = NULL, ind)

Arguments

lat
Latitude of points or list containing lat,lon.
lon
Longitude of data points. If missing, this must be part of the lat argument.
ind
Selection criterion.

Value

Returns list with elements lat,lon which satisfy the criterion.

Details

The normal way of working with geographical data is to store positions as a list with names lat and lon. This is easier for most applications, except selection of subsets, where it is essential to access individual elements. The purpose of this routine is merely to ease the selection process.

See Also

geoplot,

Examples

Run this code
## Not run: 
#              subs<-selpos(pos,,z>6)# Select positions where z>6
# 
#        The Function is trivially defined as
#        function(lat, lon = NULL, ind)
#        {
#                       if(is.null(lon)) {
#                            lon <- lat$lon
#                            lat <- lat$lat
#                       }
#                       lat <- lat[ind]
#                       lon <- lon[ind]
#                       return(lat, lon)
#        }
# ## End(Not run)

Run the code above in your browser using DataLab