summaryByPlot: Summarize by plot (or subplot) the posterior distribution of...

Description Usage Arguments Details Value Examples

Description

This function summarizes the matrix AGB_val given by the function AGBmonteCarlo() by plot. Or just do the sums for each plot of the AGB if the argument AGB_val is the resulting vector from the function computeAGB().

Usage

1
summaryByPlot(AGB_val, plot, drawPlot = FALSE, subplot = NULL)

Arguments

AGB_val

Matrix resulting from the function AGBmonteCarlo() (AGB_val element of the list), or just the output of the function AGBmonteCarlo(). Or the output of the function computeAGB()

plot

Vector with the code of plot

drawPlot

a logical to draw the plot (see Details)

subplot

Data frame, output of the function cutPlot()

Details

If some trees belong to an unknown plot (i.e. NA value in the plot arguments), their AGB values are randomly assigned to a plot at each iteration of the AGB monte Carlo approach. Or discarded when using output from computeAGB().

The drawPlot argument is a logical that if it is set TRUE``, a graph will appear with the plot given on absciss and the value of AGB on ordinate, the red segments are the quantile, if AGB_valis the result of the function [AGBmonteCarlo()]. If thesubplotarguments is set and thedrawPlotis setTRUE', a graph is drawn with the spatialisation of the plots.

Value

a data frame where:

If the subplot is set, the output is a list with the previous data frame and an sf::st_sf().

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
# Load a database
data(NouraguesHD)
data(KarnatakaForest)

# Modelling height-diameter relationship
HDmodel <- modelHD(D = NouraguesHD$D, H = NouraguesHD$H, method = "log2")

# Retrieving wood density values
KarnatakaWD <- getWoodDensity(KarnatakaForest$genus, KarnatakaForest$species,
  stand = KarnatakaForest$plotId
)

# Propagating errors
filt <- KarnatakaForest$plotId %in% c("BSP20", "BSP14")
resultMC <- AGBmonteCarlo(
  D = KarnatakaForest$D[filt], WD = KarnatakaWD$meanWD[filt],
  errWD = KarnatakaWD$sdWD[filt], HDmodel = HDmodel
)

plot <- KarnatakaForest$plotId[ filt ]

# The summary by plot
summaryByPlot(AGB_val = resultMC$AGB_simu, plot)

# The summary by plot for computeAGB
H <- retrieveH(KarnatakaForest$D[filt], model = HDmodel)$H
AGB <- computeAGB(KarnatakaForest$D[filt], WD = KarnatakaWD$meanWD[filt], H = H)
summaryByPlot(AGB, plot)

ArthurPERE/biomass documentation built on May 18, 2019, 2:33 a.m.