Learn R Programming

YplantQMC (version 0.6-3)

randomplant: 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: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object] 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: LAD = angledist("const", 45) To assign a spherical LAD, use this command: LAD = angledist("spherical")

Usage

randomplant(nleaves = 500, leaflen = 30, LA = NULL, radius = 250,
  height = 500, crownbase = 0, crownshape = c("BOX", "CONE", "HELIP",
  "PARA", "ELIP", "CYL"), LAD = LeafAngle::angledist("spherical"),
  lfile = NULL, writefile = FALSE, quiet = FALSE)

Arguments

nleaves
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.

See Also

constructplant

Examples

Run this code
# 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))

Run the code above in your browser using DataLab