R: Generate a plant with randomly distributed leaves
randomplant
R Documentation
Generate a plant with randomly distributed leaves
Description
Generates a plant crown with specified total leaf area or number of leaves,
in one of six crown shapes. These include cone, paraboloid, cylinder, and
others. Leaves are randomly distributed in the crown shapes.
Six crown shapes are implemented, use one of the following abbreviations for
the argument crownshape:
BOX
A box shape; radius in X and Y directions assumed to be the same.
CONE
A cone shape.
HELIP
A half ellipsoid (the top half of a full ellipsoid).
PARA
A paraboloid.
ELIP
A full ellipsoid.
CYL
Cylinder shape.
The leaf angle distribution (LAD) must be specified using the
angledist function in the LeafAngle package. To assign a
constant leaf angle of 45 degrees, use this command:
Number of leaves, can be left unspecified if leaf area (LA) is
given.
leaflen
The leaf length (constant value for all leaves).
LA
Total leaf area, optional (m2)
radius
Crown radius (mm).
height
Crown height (mm).
crownbase
Height to crownbase (mm).
crownshape
One of six pre-specified crown shapes. See Details.
LAD
Leaf angle distribution.
lfile
Name of the leaf file (see readl), if left
unspecified a triangle is used.
writefile
Logical. If TRUE, writes a Q file to disk.
quiet
Logical. If FALSE, no messages are printed to the console.
Value
Produces a plant in the Q file format, see
constructplant for details. If writefile=TRUE, the Q
file is written to the current working directory. Otherwise, returns a
dataframe that can be used directly in constructplant, see Details.
Note
Currently only random distributions are supported. I have at this time
no idea how to produce non-random (clumped or uniform) distributions in 3D!
Author(s)
Remko Duursma. Uses code from Belinda Medlyn (SURFACE subroutine in
MAESTRA).
See Also
constructplant
Examples
## Not run:
# An ellipsoid shape crown, write a Q file to disk.
# Specify approximate total leaf area.
randomplant(radius=400, height=2000, shape="ELIP",
leaflen=40, LA=1.5, writefile=TRUE)
# Embed the function in a call to 'constructplant', giving a plant in the
# YplantQMC format.
# Because no leaf file is specified, it uses a built-in triangle-shaped leaf.
coneplant <- constructplant(randomplant(radius=250, height=500, shape="CONE",
leaflen=25, LA=1))
## End(Not run)