PlottingINFCaccuracy: Plotting the accuracy and reliability region (or 'domain') of...

Description Usage Arguments Value Examples

Description

Volume and phytomass functions are tabulated in Tabacchi et al. (2011a). The tabulation covers a limited region of the dbh by h_tot rectangle. This region is the "domain" of the reliable estimates, based on the distribution of the sample trees used to calibrate the functions. The coefficient of variation (CV = standard_deviation / estimate) is computed and plotted (as 'filled contours') for the whole rectangular area, the limits of the region of reliable estimates (the "domain"), is superimposed as a light coloured line. Function output is a ggplot object that can be used by its self or as a backgrund on top of which the user can plot his/her data to verify eventual accuracy or reliability problems.
Two functions are available.

(** compute_grid0() - is an internal function expotred for the sake of the Populate_INFC_CVgrid() function **)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
INFCaccuracyPlot(
  EPPOcod,
  quantity = "vol",
  ie.Var = FALSE,
  cv.ul = 0.1,
  fixed = TRUE,
  plot.est = FALSE,
  dbh.step = 5,
  htot.step = dbh.step,
  dbh.buf = 1,
  htot.buf = dbh.buf
)

INFCaccuracyPlot0(
  EPPOcod,
  quantity = "vol",
  ie.Var = FALSE,
  cv.ul = 0.1,
  fixed = TRUE,
  plot.est = FALSE
)

compute_grid0(pag, EPPOcod, quantity)

Arguments

EPPOcod

A string, one of the EPPO tree species codes listed in INFCspecies table (Reference: https://gd.eppo.int )

quantity

(optional) A string specifying the quantity to be estimated, one of c("vol", "dw1" : "dw4"). Lookup Qantities table to retrieve codes definitions. Defaults to "vol".

ie.Var

(optional) Logical. Choose variance estimator:

  • TRUE = variance for an 'individual estimate'

  • FALSE = variance for the 'estimate of an avarage' value Default ie.Va = FALSE

cv.ul

(optional) Numeric. Cutoff CV level for the plot. Defaults to 0.1

fixed

(optional) Logical. Contur plot breaks:

  • TRUE = break levels are fixed

  • FALSE = breaks are tailored to the specific case (in order to split the values within the range of interest [0, cv.ul], into equally numerous bins) Default fixed = TRUE

plot.est

(optional) Logical. Add the 'estimated quantity' layer as contour lines. Default plot.est = FALSE

dbh.step

(optional) Numeric. Computation with smaller step produces a plot with better resolution but increases consitently computation time (see INFCaccuracyPlot0()). To reduce coputation time, the step defaults to 5.

htot.step

(optional) Numeric. As for dbh.

dbh.buf

(optional) Numeric. Extra space in the plot beyond the 'domain'. Default: 1

htot.buf

(optional) Numeric. As for dbh.

pag

for the internal function compute_grid0()

Value

INFCaccuracyPlot The function returns a ggplot object.

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
INFCaccuracyPlot("FRXAN") # 'INFCaccuracyPlot()' can be slow because
#       it computes all the CV values needed to fill backgroud plot,
#              hence default values are set to a coarser resolution.

  INFCaccuracyPlot("FRXAN",
                   dbh.step = 1,
                   htot.step = 1) # computing with high resolution is slow


INFCaccuracyPlot0("FRXAN") # 'INFCaccuracyPlot0()' is quick, it uses stored values
INFCaccuracyPlot0("FRXAN", "dw4")
INFCaccuracyPlot0("FRXAN", "dw4", ie.Var = TRUE) # deafult fixed break values are not alwais optimal
INFCaccuracyPlot0("FRXAN", "dw4", ie.Var = TRUE, fixed = FALSE, cv.ul=.9) # tailoring can improve
INFCaccuracyPlot0("FRXAN", plot.est = TRUE) # 'quantity' estimation iso-lines can be superimposed


background <- INFCaccuracyPlot0("ACROP", plot.est = TRUE)
foreground <-  ForIT_test_data %>%
  dplyr::filter(specie == "ACROP") %>%
  dplyr::mutate(vol = INFCvpe(specie, d130, h_dendro)) %>%
  ggplot2::geom_point(map = ggplot2::aes(h_dendro, d130, size = vol))
background + foreground  # Adding a custom foreground
rm(background, foreground)

INFCaccuracyPlot0("ABIAL") # high resolution and quick, using pre-calculated backgroung values
INFCaccuracyPlot("ABIAL") # default values produce coarser resolution

npuletti/ForIT documentation built on Dec. 29, 2021, 7:50 a.m.