| Type: | Package |
| Title: | Forest Carbon Sequestration and Potential Productivity Calculation |
| Version: | 1.2.0 |
| Description: | Include assessing site classes based on the stand height growth and establishing a nonlinear mixed-effect biomass model under different site classes based on the whole stand model to achieve more accurate estimation of carbon sequestration. In particular, a carbon sequestration potential productivity calculation method based on the potential mean annual increment is proposed. This package is applicable to both natural forests and plantations. It can quantitatively assess stand’s potential productivity, realized productivity, and possible improvement under certain site, and can be used in many aspects such as site quality assessment, tree species suitability evaluation, and forest degradation evaluation. Reference: Lei X, Fu L, Li H, et al (2018) <doi:10.11707/j.1001-7488.20181213>. Fu L, Sharma R P, Zhu G, et al (2017) <doi:10.3390/f8040119>. |
| License: | GPL (≥ 3) |
| Maintainer: | Yuanyuan Han <jackhanyuan@foxmail.com> |
| URL: | https://github.com/caf-ifrit/forestat |
| BugReports: | https://github.com/caf-ifrit/forestat/issues |
| Encoding: | UTF-8 |
| Language: | en-US |
| LazyData: | true |
| Depends: | R (≥ 3.5.0) |
| RoxygenNote: | 7.3.2 |
| Imports: | dplyr, ggplot2, graphics, nlme, stats, rlang |
| Suggests: | knitr, rmarkdown |
| VignetteBuilder: | knitr |
| NeedsCompilation: | no |
| Author: | Liyong Fu [aut], Shirong Liu [aut], Shouzheng Tang [aut], Guangshuang Duan [aut], Zhong Wang [aut], Linyan Feng [aut], Dongbo Xie [aut], Yuanyuan Han [aut, cre] |
| Packaged: | 2026-09-29 07:46:23 UTC; CodexSandboxOffline |
| Repository: | CRAN |
| Date/Publication: | 2026-10-09 04:00:02 UTC |
Calculate Fitting Evaluation Indices
Description
This function calculates several fitting evaluation indices based on estimated and observed values.
Usage
FittingEvaluationIndex(EstiH, ObsH)
Arguments
EstiH |
A numeric vector of estimated values. |
ObsH |
A numeric vector of observed values. |
Details
EstiH and ObsH must have the same length. Non-finite pairs are
removed, and at least two finite pairs are required. R2 is NA when all
observed values are equal, and TRE is NA when all estimated values are
zero.
Value
A named numeric vector with evaluation indices:
- pe
Mean error
- RMSE
Root Mean Squared Error
- R2
Coefficient of determination
- Var
Variance of the error
- TRE
Total Relative Error (percentage)
Examples
FittingEvaluationIndex(c(1, 2, 4), c(1, 3, 5))
Birch Dataset
Description
A dataset containing information about birch trees in the Winter Olympics core area.
Usage
birch
Format
A data frame with 2603 rows and 17 variables:
- PLOT
Numeric sample plot identifier.
- TREE
Tree species code; always "birch" in this dataset.
- D
Diameter at breast height (DBH) of the tree, in centimeters.
- H
Height of the tree, in meters.
- CBH
Crown base height (branch-free height), in meters.
- LIFE
Tree condition code: "alive", "broken_head", "dead", "healthy", "standing_dead", "unknown", or "withered_tip".
- CW_E
Horizontal crown extent from the stem toward the east, in meters.
- CW_S
Horizontal crown extent from the stem toward the south, in meters.
- CW_W
Horizontal crown extent from the stem toward the west, in meters.
- CW_N
Horizontal crown extent from the stem toward the north, in meters.
- X
Within-plot X-coordinate of the tree, in meters; missing coordinates are
NA.- Y
Within-plot Y-coordinate of the tree, in meters; missing coordinates are
NA.- SD
Stand density, in trees per hectare.
- CLR
Crown length ratio, calculated as crown length divided by tree height.
- CW
Mean crown diameter, calculated as the mean of
CW_EWandCW_SN, in meters.- CW_EW
East-west crown diameter, calculated as
CW_E + CW_W, in meters.- CW_SN
South-north crown diameter, calculated as
CW_S + CW_N, in meters.
Details
Paired zero coordinates used as missing-value placeholders in the
source records are represented as NA.
Calculating degraded forest grade
Description
Calculation of degraded forest grade.
Usage
calc_degraded_forest_grade(plot_data)
Arguments
plot_data |
Preprocessed plot_data |
Details
Calculation of degraded forest grade, icluding p1, p2,p3, p4, p5, p1m, p2m, p3m, p4m, Z1, Z2, Z3, Z4, Z5, Z, Z_weights, Z_grade, Z_weights_grade etc.
Value
res_data with degraded forest grade
Examples
# Load forest survey data
data(tree_1)
data(tree_2)
data(tree_3)
data(plot_1)
data(plot_2)
data(plot_3)
# Preprocess the degraded forest data
plot_data <- degraded_forest_preprocess(tree_1,tree_2,tree_3,plot_1,plot_2,plot_3)
# Calculation of degraded forest grade
res_data <- calc_degraded_forest_grade(plot_data)
Calculate the site classes based on stand height growth
Description
class.plot adds new variables: the original height classes and the adjusted height classes. And the existing variables are retained.
Usage
class.plot(
data,
model = "Richards",
interval = 5,
number = 5,
maxiter = 1000,
H_start = c(a = 20, b = 0.05, c = 1),
BA_start = c(a = 80, b = 1e-04, c = 8, d = 0.1),
Bio_start = c(a = 450, b = 1e-04, c = 12, d = 0.1)
)
Arguments
data |
A data.frame data in which at least four columns are required as input: ID, code, AGE, H. |
model |
Type of model used for building the H-model (stand height model), options are 'Logistic', 'Richards', 'Korf', 'Gompertz', 'Weibull', or 'Schumacher'. |
interval |
The initial stand age interval for height classes. |
number |
The maximum number of initial height classes. |
maxiter |
The maximum number of iterations to fit the H-model. |
H_start |
The initial parameters for fitting the H-model, the default value is c(a=20,b=0.05,c=1.0). |
BA_start |
The initial parameters for fitting the BA-model, the default value is c(a = 80, b = 0.0001, c = 8, d = 0.1). |
Bio_start |
The initial parameters for fitting the Bio-model, the default value is c(a=450, b=0.0001, c=12, d=0.1). |
Details
Input takes a data.frame with three variables ID, AGE, H and returns height classes of every sample (rows in the data.frame).
Value
A data of forestData class with output values, models and model parameters.
Examples
if (interactive()) {
# Load sample data
data("forestData")
# Build a model based on the forestData and return a forestData class object
forestData <- class.plot(forestData,model="Richards",
interval=5,number=5,maxiter=1000,
H_start=c(a=20,b=0.05,c=1.0))
}
Preprocess the degraded forest data
Description
Preprocess the degraded forest data and return the plot_data.
Usage
degraded_forest_preprocess(tree_1, tree_2, tree_3, plot_1, plot_2, plot_3)
Arguments
tree_1 |
Tree data for the 1st period |
tree_2 |
Tree data for the 2nd period |
tree_3 |
Tree data for the 3rd period |
plot_1 |
Sample plot data for the 1st period |
plot_2 |
Sample plot data for the 2nd period |
plot_3 |
Sample plot data for the 3rd period |
Details
tree_1, tree_2, tree_3 are required to include the fields "plot_id", "inspection_type", and "tree_species_code". plot_1, plot_2, and plot_3 are required to include the fields "plot_id", "standing_stock", "forest_cutting_stock", "crown_density", "disaster_level", "origin", "dominant_tree_species", "age_group", "naturalness", and "land_type".
Value
Preprocessed plot_data
Examples
# Load forest survey data
data(tree_1)
data(tree_2)
data(tree_3)
data(plot_1)
data(plot_2)
data(plot_3)
# Preprocess the degraded forest data
plot_data <- degraded_forest_preprocess(tree_1,tree_2,tree_3,plot_1,plot_2,plot_3)
Mixed birch-broadleaf forest data
Description
Mixed birch-broadleaf forest data
Usage
forestData
Format
'forestData' A data frame with 320 rows and 16 columns:
- ID
Plot ID
- AGE
The average age of the stand
- H
Stand height
- BA
Stand basal area
- Bio
Stand biomass
- S
Stand density index
- code
Forest type code of plot
...
Larch Dataset
Description
A dataset containing information about larch trees in the Winter Olympics core area.
Usage
larch
Format
A data frame with 4538 rows and 18 variables:
- PLOT
Numeric sample plot identifier.
- TREE
Tree species code; always "larch" in this dataset.
- D
Diameter at breast height (DBH) of the tree, in centimeters.
- H
Height of the tree, in meters.
- CBH
Crown base height (branch-free height), in meters.
- LIFE
Tree condition code: "alive", "broken_head", "broken_tip", "healthy", or "unknown".
- CW_E
Horizontal crown extent from the stem toward the east, in meters.
- CW_S
Horizontal crown extent from the stem toward the south, in meters.
- CW_W
Horizontal crown extent from the stem toward the west, in meters.
- CW_N
Horizontal crown extent from the stem toward the north, in meters.
- X
Within-plot X-coordinate of the tree, in meters; missing coordinates are
NA.- Y
Within-plot Y-coordinate of the tree, in meters; missing coordinates are
NA.- SD
Stand density, in trees per hectare.
- CLR
Crown length ratio, calculated as crown length divided by tree height.
- CW
Mean crown diameter, calculated as the mean of
CW_EWandCW_SN, in meters.- CW_EW
East-west crown diameter, calculated as
CW_E + CW_W, in meters.- CW_SN
South-north crown diameter, calculated as
CW_S + CW_N, in meters.- AGE.GROUP
Age-group label stored in Chinese, with categories corresponding to young, middle-aged, near-mature, mature, and over-mature forest.
Details
Paired zero coordinates used as missing-value placeholders in the
source records are represented as NA; an isolated zero is retained as
a valid plot-boundary coordinate.
Qinghai Spruce Dataset
Description
A dataset containing information about Qinghai spruce trees at the Xishui forest farm of Su'nan Yuguzu Autonomous County, China, in Gansu Qilian Mountain National Nature Reserve.
Usage
picea
Format
A data frame with 402 rows and 24 variables:
- LIDAR-X
Projected X-coordinate of the LIDAR-detected tree, in meters.
- LIDAR-Y
Projected Y-coordinate of the LIDAR-detected tree, in meters.
- LH
Tree height derived from LIDAR data, in meters.
- LHCB
Crown base height derived from LIDAR data, in meters.
- LCW1
East-west crown diameter derived from LIDAR data, in meters.
- LCW2
South-north crown diameter derived from LIDAR data, in meters.
- LCW
Mean LIDAR-derived crown diameter, calculated as the mean of
LCW1andLCW2, in meters.- CPA
Crown projection area, in square meters.
- X
Projected X-coordinate of the ground-measured tree, in meters.
- Y
Projected Y-coordinate of the ground-measured tree, in meters.
- Z
Elevation of the tree base, in meters above sea level.
- PLOT
Character sample plot name, from "yd01" to "yd16".
- PLOT1
Numeric sample plot identifier, from 1 to 16.
- OBS
Tree observation identifier.
- D0
Ground-measured diameter at breast height (DBH), in centimeters.
- H0
Ground-measured height of the tree, in meters.
- HCB0
Crown base height (branch-free height) measured on the ground, in meters.
- CW01
Ground-measured east-west crown diameter, in meters.
- CW02
Ground-measured south-north crown diameter, in meters.
- CW
Mean ground-measured crown diameter, calculated as the mean of
CW01andCW02, in meters.- STEM
Estimated biomass of the tree stem, in kilograms.
- BRANCH
Estimated biomass of the tree branches, in kilograms.
- FOLIAGE
Estimated biomass of the tree foliage, in kilograms.
- FRUIT
Estimated biomass of the tree fruit, in kilograms.
ForestData Plot
Description
Plot graphs about the forestData.
Usage
## S3 method for class 'forestData'
plot(
x,
model.type = "H",
plot.type = "Curve",
xlab = NA,
ylab = NA,
legend.lab = "Site class",
title = "Mixed birch-broadleaf forest",
...
)
Arguments
x |
A data of forestData class. |
model.type |
Type of model used for fitting, options are 'H' (stand height growth model), 'BA' (stand basal area model), or 'Bio' (stand biomass model). |
plot.type |
Type of plot, options are 'Curve' (curve plot), 'Scatter_Curve' (scatter plot with curve), 'Residual' (residual plot), or 'Scatter' (scatter plot). |
xlab |
The title for the x axis. |
ylab |
The title for the y axis. |
legend.lab |
The title for the legends. |
title |
The text for the Plot title. |
... |
Additional arguments affecting the figure plotted. |
Value
A trellis plot object
Examples
if (interactive()) {
# Load sample data
data("forestData")
# Build a model based on the forestData and return a forestData class object
forestData <- class.plot(forestData,model="Richards",
interval=5,number=5,maxiter=1000,
H_start=c(a=20,b=0.05,c=1.0))
# Plot the curve of the height classes
plot(forestData, model.type="H",
plot.type="Curve",
xlab="Stand age (year)",ylab="Height (m)",legend.lab="Site class",
title="The H-model curve of the mixed birch-broadleaf forest")
}
1st period sample plot survey data
Description
The 1st period sample plot survey data (e.g. 2005)
Usage
plot_1
Format
'plot_1' A data frame with 62 rows and 23 columns:
- plot_id
Plot ID
- standing_stock
Standing stock
- forest_cutting_stock
Forest cutting stock
- crown_density
Crown density
- disaster_level
Disaster level
- origin
origin
- dominant_tree_species
Dominant tree species
- age_group
Age group
- naturalness
Naturalness
- land_type
Land type
...
2nd period sample plot survey data
Description
The 2nd period sample plot survey data (e.g. 2010)
Usage
plot_2
Format
'plot_2' A data frame with 100 rows and 5 columns:
- plot_id
Plot ID
- standing_stock
Standing stock
- forest_cutting_stock
Forest cutting stock
- crown_density
Crown density
- disaster_level
Disaster level
- origin
origin
- dominant_tree_species
Dominant tree species
- age_group
Age group
- naturalness
Naturalness
- land_type
Land type
...
3rd period sample plot survey data
Description
The 3rd period sample plot survey data (e.g. 2015)
Usage
plot_3
Format
'plot_3' A data frame with 100 rows and 5 columns:
- plot_id
Plot ID
- standing_stock
Standing stock
- forest_cutting_stock
Forest cutting stock
- crown_density
Crown density
- disaster_level
Disaster level
- origin
origin
- dominant_tree_species
Dominant tree species
- age_group
Age group
- naturalness
Naturalness
- land_type
Land type
...
Calculate the potential productivity.
Description
potential.productivity calculate the potential productivity of stand based on model parameters(obtained from the parameterOutput function).
Usage
potential.productivity(
forestData,
code = 1,
age.min = 5,
age.max = 150,
left = 0.05,
right = 100,
e = 1e-05,
maxiter = 50
)
Arguments
forestData |
A forestData class data |
code |
Codes for forest types. |
age.min |
The minimum age of the stand. |
age.max |
The maximum age of the stand. |
left |
Solving for the left boundary of the potential productivity. |
right |
Solving for the right boundary of the potential productivity. |
e |
Accuracy parameters for solving the stand density index according to Newton's iterative method. |
maxiter |
Maximum number of iterations parameter for solving the stand density index according to Newton's iteration method. |
Details
potential.productivity takes data_BA,data_V parameters as required inputs.
Value
A forestData class in which a data.frame with potential productivity parameters is added.
Examples
if (interactive()) {
# Load sample data
data("forestData")
# Build a model based on the forestData and return a forestData class object
forestData <- class.plot(forestData,model="Richards",
interval=5,number=5,maxiter=1000,
H_start=c(a=20,b=0.05,c=1.0))
# Calculate the potential productivity of the forestData object
forestData <- potential.productivity(forestData,code=1,
age.min=5,age.max=150,
left=0.05,right=100,
e=1e-05,maxiter=50)
}
Calculate the realized productivity.
Description
realized.productivity calculate the realized productivity of each stand based on model parameters (obtained from the parameterOutput function).
Usage
realized.productivity(forestData, left = 0.05, right = 100)
Arguments
forestData |
A forestData class data |
left |
Solving for the left boundary of the realized productivity. |
right |
Solving for the right boundary of the realized productivity. |
Details
realized.productivity takes data,data_BA,data_V parameters as required inputs.
Value
A forestData class in which a data.frame with realized productivity parameters is added.
Examples
if (interactive()) {
# Load sample data
data("forestData")
# Build a model based on the forestData and return a forestData class object
forestData <- class.plot(forestData,model="Richards",
interval=5,number=5,maxiter=1000,
H_start=c(a=20,b=0.05,c=1.0))
# Calculate the realized productivity of the forestData object
forestData <- realized.productivity(forestData,left=0.05,right=100)
}
Summary of forestData
Description
Generates summary statistics for forestData objects.
Usage
## S3 method for class 'forestData'
summary(object, ...)
Arguments
object |
A forestData object (after class.plot). |
... |
Additional arguments affecting the summary produced. |
Details
The summary includes the summary of raw data, the model, the model parameters, potential productivity and real productivity in forestData(if available)
Value
A summary object of class "summary.forestData"
Examples
if (interactive()) {
# Load sample data
data("forestData")
# Build a model based on the forestData and return a forestData class object
forestData <- class.plot(forestData,model="Richards",
interval=5,number=5,maxiter=1000,
H_start=c(a=20,b=0.05,c=1.0))
# Get the summary data of the forestData object
summary(forestData)
}
1st period trees survey data
Description
The 1st period trees survey data (e.g. 2005)
Usage
tree_1
Format
'tree_1' A data frame with 1634 rows and 5 columns:
- plot_id
Plot ID
- inspection_type
Inspection type
- tree_species_code
Tree species code
...
2nd period trees survey data
Description
The 2nd period trees survey data (e.g. 2010)
Usage
tree_2
Format
'tree_2' A data frame with 4778 rows and 5 columns:
- plot_id
Plot ID
- inspection_type
Inspection type
- tree_species_code
Tree species code
...
3rd period trees survey data
Description
The 3rd period trees survey data (e.g. 2015)
Usage
tree_3
Format
'tree_3' A data frame with 4528 rows and 5 columns:
- plot_id
Plot ID
- inspection_type
Inspection type
- tree_species_code
Tree species code
...