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

makeProps

Make Polygon Properties


Description

Append a column for a polygon property (e.g., border or lty) to PolyData based on measurements in the PolyData's Z column.

Usage

makeProps(pdata,breaks,propName="col",propVals=1:(length(breaks)-1))

Arguments

pdata

PolyData with a Z column.

breaks

either a vector of cut points or a scalar denoting the number of intervals that Z is to be cut into.

propName

name of the new column to append to pdata.

propVals

vector of values to associate with Z breaks.

Details

This function acts like the cut function to produce PolyData suitable for the polyProps plotting argument (see addLabels, addLines, addPoints, addPolys, addStipples, plotLines, plotMap,plotPoints, and plotPolys). The Z column of pdata is equivalent to the data vector x of the cut function.

Value

PolyData with the same columns as pdata plus an additional column propName.

Author(s)

Nicholas M. Boers, Associate Professor – Computer Science
MacEwan University, Edmonton AB
Last modified Rd: 2013-04-10

See Also

Examples

local(envir=.PBSmapEnv,expr={
  #--- create a PolyData object
  pd <- data.frame(PID=1:10, Z=1:10)

  #--- using 3 intervals, create a column named `col' and populate it with
  #--- the supplied values
  makeProps(pdata=pd, breaks=3, propName="col", propVals=c(1:3))
})

PBSmapping

Mapping Fisheries Data and Spatial Analysis Tools

v2.73.0
GPL (>= 2)
Authors
Jon T. Schnute [aut], Nicholas Boers [aut], Rowan Haigh [aut, cre], Alex Couture-Beil [ctb], Denis Chabot [ctb], Chris Grandin [ctb], Angus Johnson [ctb], Paul Wessel [ctb], Franklin Antonio [ctb], Nicholas J. Lewin-Koh [ctb], Roger Bivand [ctb]
Initial release
2021-01-12

We don't support your browser anymore

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