| BAplot | R Documentation |
Plot basal areas of trees on a map of quadrats. If individual tree coordinates are not known, the coordinates inside the quadrats are randomly defined according to the uniform distribution.
BAplot(
formula,
data,
taxon = "taxon",
circumference = TRUE,
quadrat.size,
dead = "dead",
rm.dead = FALSE,
origin = c(0, 0),
col = "grey40",
alpha = 1,
cex.radius = 1,
ind.coord = FALSE,
legend = TRUE,
long = FALSE
)
formula |
A model formula indicating the trunk measure (circumference [default]
or diameter) in centimeters and the xy coordinates of each quadrat the tree belongs
( |
data |
A data frame containing the community sample data. See Details. |
taxon |
Name of the column representing the sampled taxa. Default is |
circumference |
Logical. If |
quadrat.size |
A vector indicating the side lengths (in meters) of the x and y quadrat
sides (e.g., |
dead |
String used to identify the dead individuals. Default is |
rm.dead |
Logical. If |
origin |
A numeric vector indicating the map origin coordinates. Default is |
col |
Circle color of represented basal areas. This argument has value only if
|
alpha |
Value of transparency factor: zero (100% transparent) – 1 (no transparency). Default is 1. |
cex.radius |
A numerical value giving the amount by which the tree radius should be magnified relative to the actual measure. Default is 1. |
ind.coord |
Logical indicating whether the individual coordinates are given. If
|
legend |
Logical. If |
long |
Logical. If |
BAplot uses the function circleRepelLayout() from the packcircles package
to rearrange circle coordinates to avoid overlapping. The minimum distance allowed among trees
is 1 meter. The packages ggforce and ggplot2 are used to draw the map.
The data frame passed to the data argument must include two columns indicating x and y
coordinates of each quadrat that the tree belongs or the actual tree coordinates. If actual
coordinates are supplied, the ind.coord argument must be set TRUE.
Circumference/diameter measures accept the traditional notation for multiple trunks, e.g.,
"17.1+8+5.7+6.8". The plus sign is the separator for each trunk measure. Decimal
separator can be point or comma and spaces after or before "+" are ignored by the function.
A plot representing the quadrat map and tree basal areas. If long = TRUE, the
function returns a data frame containing taxon name, xy coordinates and radius of each sampled tree.
Rodrigo A. S. Pereira (raspereira@usp.br)
Collins, C. R., and Stephenson, K. (2003). A circle packing algorithm. Computational Geometry, 25(3), 233–256. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/S0925-7721(02)00099-8")}
Wang, W., Wang, H., Dai, G., and Wang, H. (2006). Visualization of large hierarchical data by circle packing. Proceedings of the SIGCHI Conference on Human Factors in Computing Systems, 517–520. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1145/1124772.1124851")}
# Using plot coordinates (random coordinates for individuals)
data1 <- quadrat2_plot.df
BAplot(formula = CBH ~ x + y, data = data1, taxon = "Species",
circumference = TRUE, quadrat.size = 5, dead = "Morta",
rm.dead = FALSE, alpha = 0.4, cex.radius = 2,
legend = TRUE, long = FALSE, ind.coord = FALSE)
# Using actual coordinates
data2 <- quadrat2_tree.df
BAplot(formula = CBH ~ x + y, data = data2, taxon = "Species",
circumference = TRUE, quadrat.size = 5, dead = "Morta",
rm.dead = FALSE, alpha = 0.4, cex.radius = 2,
legend = TRUE, long = FALSE, ind.coord = TRUE)
# Rectangular plots and plot coordinates
data3 <- quadrat3_rect.df
BAplot(formula = DBH ~ x + y, data = data3, taxon = "Species",
circumference = FALSE, quadrat.size = c(20, 10),
dead = "Morta", rm.dead = FALSE, col = "blue",
alpha = 0.4, cex.radius = 2, legend = FALSE,
long = FALSE, ind.coord = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.