establishTrees: poplulate a patch with its vegetation

Description Usage Arguments Value Examples

Description

Randomly 'plant' the trees in the patch within a given radius.

Usage

1
establishTrees(vegetation = NULL, radius = 1, jitter = FALSE, ...)

Arguments

vegetation

the vegetation data.frame

radius

the radius used to distribute the vegetation to

jitter

add a small amount of noise to the positions. Applies only for dgvm3d.options("establish.method") = "row" or "sunflower" (default: FALSE).

...

additiontal parameters passed to jitter.

Value

the vegetation data.frame with the positions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## Not run: 
dgvm3d.options("default")
stand = initStand(npatch=1)
veg = data.frame(DBH=rep(0.5, 100))
veg$Height    = veg$DBH * 35
veg$Crownarea = veg$DBH * 10
veg$LeafType  = sample(1:2, nrow(veg), replace=TRUE)
veg$ShadeType = sample(1:2, nrow(veg), replace=TRUE)
stand@patches[[1]]@vegetation = establishTrees(veg, stand@hexagon@supp[['inner.radius']])
stand3D(stand)
dummy = plant3D(stand)
rot.z = rotationMatrix(0, 0, 0, 1)
rot.y = rotationMatrix(0, 1, 0, 0)
rgl.viewpoint(userMatrix = rot.y %*% rot.z, fov=1)

rgl.clear()
dgvm3d.options(establish.method = "sunflower")
stand@patches[[1]]@vegetation = establishTrees(veg, stand@hexagon@supp[['inner.radius']])
stand3D(stand)
dummy = plant3D(stand)

rgl.clear()
dgvm3d.options(establish.method = "row")
stand@patches[[1]]@vegetation = establishTrees(veg, stand@hexagon@supp[['inner.radius']],
                                               jitter=TRUE, amount=0.01)
stand3D(stand)
dummy = plant3D(stand)

## End(Not run)

DGVM3D documentation built on May 2, 2019, 3:47 p.m.