net.map {stream.net} | R Documentation |
Draw map of stream network by symbolizing segments
according to a classification of segment or link
attributes obtained from net.group
,
using colors or line widths, or just according to
a set of colors or line widths directly associated
with the segments.
net.map (net, group=NULL, linkatt=NULL, segatt=NULL, col=NULL, lwd=NULL, cex=par("cex"), new=TRUE, outline=NULL, uniquegroup=FALSE)
net |
A net.object . |
group |
if not NULL , then a vector of color
codes for each segment. names(group) must
match sid s. |
segatt |
if not NULL then write the
attribute value associated with each segment in text
format at the midpoint of the segment.
If segatt is a character vector of length one,
then get attribute from net$segs$segatt , else
assume segatt is a numeric vector of length
equal to number of segments and in correct order. |
linkatt |
if not NULL then write the
attribute value associated with each link in text
format at the midpoint of the link.
If linkatt is a character vector of length one,
then get attribute from net$links$linkatt , else
assume linkatt is a numeric vector of length
equal to number of links and in correct order. |
col |
par parameter for color codes
for segments. Default ramp is yellow-red-brown. |
lwd |
par parameter for line widths
of segments. If lwd="seq" , generate widths in
sequence 1:(number of groups). |
cex |
par parameter for size of text. |
new |
if TRUE , then create a new plot. |
outline |
if not NULL , then shade an outline
outline polygon in light gray first before drawing
network; outline format is S/R polygon format. |
uniquegroup |
if TRUE , group categories
are not members of the integers 1:(number of groups),
assuming ! is.null (group) . |
The mapping is by segment. Link attributes can be mapped
by grouping them with net.group
where they
will be "stretched" onto the segments.
Text format labeling of attributes for segments or links is separate from (and can be in addition to) color or line width symbolism of attributes.
The names
of the group
vector must match
the sid
s (as set, for example, in
net.group
).
The values of group
are assumed to be integers.
If these values are not dense (continuous in 1:(number
of groups), then set uniquegroups=TRUE
.
If ! is.null (group)
then the colors provided or
generated else nothing in invisible
.
Denis White, white.denis@epa.gov
# Q model random net net <- net.qmodel (10) net <- net.addsegs (net) # classify some attributes class1 <- net.group (net, linkatt="shreve", method="equalInterval") class2 <- net.group (net, segatt="length") att <- seq (nrow (net$segs)) class3 <- net.group (net, segatt=att) # map net.map (net) # just draw segments in black n <- length (table (class1$group)) net.map (net, group=class1$group, col="black", lwd="seq") n <- length (table (class2$group)) net.map (net, group=class2$group, col=gray(0:n/n), linkatt="strahler") n <- length (table (class3$group)) net.map (net, group=class3$group, col=rainbow(n))