net.addatt {stream.net} | R Documentation |
Add attributes to segments of a net.object
,
generated by either a functional relationship with optional
noise added, or a distributional property.
net.addatt (net, name=NULL, func=NULL, dist=NULL, ind="shreve", sd=0.02, arg1=NULL, arg2=NULL, boundscaling=FALSE, outscaling=FALSE, prob=0.01, min=0, max=1, vector=TRUE)
net |
A net.object . |
name |
name of the attribute to be added
(if ! vector) ). |
func |
name of the functional form, see details. |
dist |
name of the distribution function, see details. |
ind |
the independent variable for functional values. |
sd |
standard deviation for added noise to func
output. Used as the proportion of the range of the produced
values. |
arg1 |
first argument to distribution functions, e.g., shape1, mean, etc. See details. |
arg2 |
second argument to distribution functions. |
boundscaling |
if TRUE , scale distribution values to
either absolute bounds of distribution or to the prob
and/or 1-prob quantile; implies outscaling is
true . |
outscaling |
if TRUE , scale return values to
[min, max] . |
prob |
probability value for scaling distributions. |
min |
minimum value for scaling output values. |
max |
maximum value for scaling output values. |
vector |
if TRUE , return a vector else a field
in $segs . |
Functional relationships create a new attribute as a function of an existing attribute. Supported functions:
Linear |
NegLinear |
Exponential |
NegExponential |
Sigmoid |
RevSigmoid |
Logarithmic |
RevLogarithmic |
Sinusoidal |
Quadratic |
Distributions create a new attribute with designated distributional properties. The assignment of distributed values is not controlled for spatial autocorrelation. Supported distributions:
Uniform | = runif (n, min=arg1, max=arg2) |
Normal | = rnorm (n, mean=arg1, sd=arg2) |
Ramp | = rbeta (n, shape1=arg1, shape2=arg2) |
NegRamp | = rbeta (n, shape1=arg1, shape2=arg2) |
Exponential | = rbeta (n, shape1=arg1, shape2=arg2) |
NegExponential | = rbeta (n, shape1=arg1, shape2=arg2) |
Lognormal | = rlnorm (n, meanlog=arg1, sdlog=arg2) |
Weibull | = rweibull (n, shape=arg1, scale=arg2) |
Unimodal | = rbeta (n, shape1=arg1, shape2=arg2) |
Logistic | = rlogis (n, location=arg1, scale=arg2) |
where the default values of arg1
and arg2
are:
Uniform | = c(0, 1) |
Normal | = c(0, 1) |
Ramp | = c(2, 1) |
NegRamp | = c(1, 2) |
Exponential | = c(100, 1) |
NegExponential | = c(1, 100) |
Lognormal | = c(0, 0.4) |
Weibull | = c(100, 100) |
Unimodal | = c(2, 2) |
Logistic | = c(0, 1) |
and the Boundscaling
values are:
Uniform | = c(0, 1) |
Normal | = c(qnorm (prob, mean=arg1, sd=arg2), qnorm (1-prob, mean=arg1, sd=arg2)) |
Ramp | = c(0, 1) |
NegRamp | = c(0, 1) |
Exponential | = c(0, 1) |
NegExponential | = c(0, 1) |
Lognormal | = c(0, qlnorm (1-prob, meanlog=arg1, sdlog=arg2)) |
Weibull | = c(0, qweibull (1-prob, shape=arg1, scale=arg2)) |
Unimodal | = c(0, 1) |
Logistic | = c(qlogis (prob, location=arg1, scale=arg2), qlogis (1-prob, location=arg1, scale=arg2)) |
If vector
is TRUE, then a vector of the attribute
values in segment order, else a net.object
with the attribute added to $segs
.
Denis White, white.denis@epa.gov
net.object
net.addsegs
runif
rnorm
rlnorm
rbeta
rweibull
rlogis
# Q model random net net <- net.qmodel (10) # add segments net <- net.addsegs (net) # add attribute based on normal distribution net <- net.addatt (net, name="normal", dist="Normal", boundscaling=TRUE, vector=FALSE) classes <- net.group (net, segatt="normal", ngroups=7, method="equalInterval") net.map (net, group=classes$group, lwd=2) net.map.key (0.8, 0.1, labels=round(classes$cuts, 2), sep=0, head="normal", horizontal=FALSE) # make attribute based on log of shreve order att <- net.addatt (net, name="slope", func="Logarithmic", ind="shreve", outscaling=TRUE, vector=TRUE) att <- (1 - att) * 10 classes <- net.group (net, att, ngroups=7, method="equalInterval") net.map (net, group=classes$group, lwd=2) net.map.key (0.6, 0.1, labels=round(classes$cuts, 0), sep=0, head="log.shreve", horizontal=TRUE)