sad: Produces Santandard Area Diagrams

View source: R/sad.R

sadR Documentation

Produces Santandard Area Diagrams

Description

Given an object computed with measure_disease() or measure_disease_byl() a Standard Area Diagram (SAD) with n images are returned with the respective severity values.

Usage

sad(
  object,
  n,
  show_original = FALSE,
  show_contour = FALSE,
  nrow = NULL,
  ncol = NULL,
  ...
)

Arguments

object

An object computed with measure_disease() or measure_disease_byl().

n

The number of leaves in the Standard Area Diagram.

show_original

Show original images? Defaults to FALSE, i.e., a mask is returned.

show_contour

Show original images? Defaults to FALSE, i.e., a mask is returned.

nrow, ncol

The number of rows and columns in the plot. See [image_combine())]

[image_combine())]: R:image_combine())

...

Other arguments passed on to measure_disease().

Details

The leaves with the smallest and highest severity will always be in the SAD. If n = 1, the leaf with the smallest severity will be returned. The others are sampled sequentially to achieve the n images after severity has been ordered in an ascending order. For example, if there are 30 leaves and n is set to 3, the leaves sampled will be the 1st, 15th, and 30th with the smallest severity values.

The SAD can be only computed if an image pattern name is used in argument pattern of measure_disease(). If the images are saved, the n images will be retrevied from dir_processed directory. Otherwise, the severity will be computed again to generate the images.

Value

A data frame with the severity values for the n sampled leaves. A plot with the standard area diagram can be saved by wrapping sad() with png().

References

Del Ponte EM, Pethybridge SJ, Bock CH, et al (2017) Standard area diagrams for aiding severity estimation: Scientometrics, pathosystems, and methodological trends in the last 25 years. Phytopathology 107:1161–1174. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1094/PHYTO-02-17-0069-FI")}

Examples

## Not run: 
library(pliman)
sev <-
measure_disease(pattern = "sev_leaf",
                img_healthy = "sev_healthy",
                img_symptoms = "sev_sympt",
                img_background  = "sev_back",
                plot = FALSE,
                save_image = TRUE,
                show_original = FALSE,
                dir_original = image_pliman(),
                dir_processed = tempdir())
sad(sev, n = 2)

## End(Not run)

pliman documentation built on Oct. 15, 2023, 1:06 a.m.

Related to sad in pliman...