clipLines | R Documentation |
Clip a PolySet, where each unique (PID
, SID
)
describes a polyline.
clipLines (polys, xlim, ylim, keepExtra = FALSE)
polys |
PolySet to clip. |
xlim |
range of X-coordinates. |
ylim |
range of Y-coordinates. |
keepExtra |
Boolean value; if |
For each discrete polyline, the function does not connect vertices 1
and N. It recalculates the POS
values for each vertex, saving
the old values in a column named oldPOS
. For new vertices, it
sets oldPOS
to NA
.
PolySet containing the input data, with some points added or
removed. A new column oldPOS
records the original POS
value for each vertex.
Nicholas M. Boers, Staff Software Engineer
Jobber, Edmonton AB
Last modified Rd: 2013-04-10
clipPolys
,
fixBound
.
local(envir=.PBSmapEnv,expr={
oldpar = par(no.readonly=TRUE)
#--- create a triangle to clip
polys <- data.frame(PID=rep(1, 3), POS=1:3, X=c(0,1,0), Y=c(0,0.5,1))
#--- clip the triangle in the X direction, and plot the results
plotLines(clipLines(polys, xlim=c(0,.75), ylim=range(polys[, "Y"])))
par(oldpar)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.