PolyData {PBSmapping}R Documentation

PolyData Objects

Description

PBS Mapping functions that expect PolyData will accept properly formatted data frames in their place (see 'Details').

as.PolyData attempts to coerce a data frame to an object with class PolyData.

is.PolyData returns TRUE if its argument is of class PolyData.

Usage

as.PolyData(x, projection = NULL, zone = NULL)
is.PolyData(x, fullValidation = TRUE)

Arguments

x data frame to be coerced or tested.
projection optional projection attribute to add to PolyData, possibly overwriting an existing attribute.
zone optional zone attribute to add to PolyData, possibly overwriting an existing attribute.
fullValidation Boolean value; if TRUE, fully test x.

Details

We define PolyData as a data frame with a first column named PID and (optionally) a second column named SID. Unlike a PolySet, where each contour has many records corresponding to the vertices, a PolyData object must have only one record for each PID or each (PID, SID) combination. Conceptually, this object associates data with contours, where the data correspond to additional fields in the data frame. The R/S language conveniently allows data frames to contain fields of various atomic modes ("logical", "numeric", "complex", "character", and "null"). For example, PolyData with the fields (PID, PName) might assign character names to a set of primary polygons. Additionally, if fields X and Y exist (perhaps representing locations for placing labels), consider adding attributes zone and projection. Inserting the string "PolyData" as the class attribute's first element alters the behaviour of some functions, including print (if PBSprint is TRUE) and summary.

Our software particularly uses PolyData to set various plotting characteristics. Consistent with graphical parameters used by the R/S functions lines and polygon, column names can specify graphical properties:

When drawing polylines (as opposed to closed polygons), only lty and col have meaning.

Value

The as.PolyData method returns an object with classes "PolyData" and "data.frame", in that order.

See Also

EventData, LocationSet, PolySet.


[Package PBSmapping version 2.09 Index]