knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of wafR is to provide data management and graphing according to the Margules Groome style guide. This package was originally developed for outputs from the New Zealand Wood Availability Forecasts produced by Margules Groome for the NZ Ministry for Primary Industries (MPI) but has now been extended to include other functions. The Margules Groome team may find these functions useful for more general graphing in the house style.
The package has been updated to include growth and yield functions that might be commonly used by the Margules Groome team.
The following is a list of package functions. More functions are being regularly added.
mdd - Calculates mean dominant DBH
Graphing helpers
MagGroome_pal - Returns the Margules Groome colour palette
Volume and Taper Functions
Bi taper functions with published coefficients for Australian Eucalypts and P. radiata in NSW.
Growth models
WAF functions
This package is not on CRAN.You can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("jonathandash/wafR")
Example of how to use the Bi taper and volume function
library(wafR) # View the stored coefficients for the Bi taper function bi_tapercoef_aus(species = 'PRAD') #Example of how to estimate stem diameter for a subject tree bi2000(DBH = 21.5, h = 20, H = 28, coefficients = bi_tapercoef_aus(species = 'PRAD')) # Example of how to estimate stem diameter for the same subject tree bi2000_volume(DBH = 21.5, stump_height = 0.3, h = 20, H = 28, coefficients = bi_tapercoef_aus(species = 'PRAD')) # Example of how to estimate stem volume a subject tree using South African coefficients from the SA forestry handbook vol_tree_safh(DBH = 21.5, H = 28, coefficients = vol_tpr_coef_sa(species = 'EGRA')) # Example of how to estimate stem volume a subject tree using South African coefficients from the SA forestry handbook tpr_max_burkhart_safh(DBH = 21.5, H = 28, h = 15, coefficients = vol_tpr_coef_sa(species = 'EGRA'))
This is a basic example which shows you how to solve a common problem:
library(wafR) ## basic example code data("WAF_allrep") volume_graph_bar(data = WAF_allrep, value = value, Year = Year, fillvariable = Ownership, WAF_form = FALSE, Species_select = 'Radiata_pine') volume_graph_bar(data = WAF_allrep, value = value, Year = Year, fillvariable = Ownership, WAF_form = TRUE, Species_select = 'Radiata_pine') # Find outliers x <- rnorm(n = 1000, mean = 100) # Create a normally distributed dataset is_outlier(x) # Find outliers boxplot(x) # Plot x to visualise the outliers
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.