Description Usage Arguments Value Examples
Randomly 'plant' the trees in the patch within a given radius.
1 | establishTrees(vegetation = NULL, radius = 1, jitter = FALSE, ...)
|
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. |
the vegetation data.frame with the positions
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.