wet2dry: Conversion between Moisture content (wet/fresh weight basis)...

Description Usage Arguments Details Value References Examples

View source: R/wet2dry.R

Description

These functions convert from moisture content determined on wet/fresh weight basis to equivalent value on dry weight basis and back. MoistureNomograph plots the nomograph for these conversions. \loadmathjax

Usage

1
2
3
4
5
dry2wet(mc)

wet2dry(mc)

MoistureNomograph(min, max, basis = c("wet", "dry"), horiz = FALSE)

Arguments

mc

Moisture content.

min

Minimum value of moisture content to be plotted in nomograph.

max

Minimum value of moisture content to be plotted in nomograph.

basis

The basis on which moisture content is estimated

horiz

If TRUE, nomograph is plotted horizontally.

Details

Conversions between moisture content (%) determined on wet weight basis \mjseqnMC_wb and that on dry weight basis \mjseqnMC_db are computed based on the formulae \insertCitecromarty_design_1982;textualviabilitymetrics as follows.

\mjsdeqn

MC_db = \frac100 \times MC_wb100-MC_wb

\mjsdeqn

MC_wb = \frac100 \times MC_db100+MC_db

\mjsdeqn

MC_wb = \fracw_i-w_fw_i

\mjsdeqn

MC_db = \fracw_i-w_fw_f

Where, \mjseqnw_i is the initial weight and \mjseqnw_f is the final weight.

If the moisture content (mc) for conversion is beyond limits (0-50 % for wet2dry and 0-100 % for dry2wet), a warning is issued.

Value

For wet2dry and dry2wet, the converted moisture content (%).

For MoistureNomograph, the nomograph as an object of class ggplot.

References

\insertRef

cromarty_design_1982viabilitymetrics

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
29
30
31
32
33
34
35
#----------------------------------------------------------------------------
# Moisture content (wet basis) to moisture content (dry basis)
#----------------------------------------------------------------------------
wet2dry(25)
# Warning if moisture content is beyond limits (0-50 %)
wet2dry(60)
wet2dry(-10)

#----------------------------------------------------------------------------
# Moisture content (dry basis) to moisture content (wet basis)
#----------------------------------------------------------------------------
dry2wet(30)
# Warning if moisture content is beyond limits (0-100 %)
dry2wet(-10)
dry2wet(110)

#----------------------------------------------------------------------------
# Nomograph
#----------------------------------------------------------------------------
# Horizontal
MoistureNomograph(min = 0, max = 50, basis = "wet", horiz = TRUE)
MoistureNomograph(min = 0, max = 100, basis = "dry", horiz = TRUE)

# Vertical
MoistureNomograph(min = 0, max = 50, basis = "wet", horiz = FALSE)
MoistureNomograph(min = 0, max = 100, basis = "dry", horiz = FALSE)

# Nomograph is a "ggplot" object
nom <- MoistureNomograph(min = 0, max = 50, basis = "wet", horiz = TRUE)
library(ggplot2)
nom + geom_hline(aes(yintercept=30), colour = "red")
p <- "Scale for converting moisture content values\nbetween dry and wet basis"
cap <- "based on Cromarty et al., 1982"
nom + labs(title  = p, caption = cap) +
  theme(plot.title = element_text(hjust = 0.5))

aravind-j/viabilitymetrics documentation built on May 15, 2021, 9:10 a.m.