View source: R/Data_handling.R
add_st | R Documentation |
Correction of matter or energy flux (flux
) with storage computed using
discrete (one point) approach (st
) or profile measurement of CO2
concentration (stp
).
add_st(flux, st, stp = NULL, name_out = "-")
flux |
A numeric vector with flux values. |
st |
A numeric vector with storage computed using discrete (one point) approach. |
stp |
A numeric vector with storage computed using profile measurement of CO2. |
name_out |
A character string providing |
If both storage estimates are available, stp
takes priority. If both
st
and stp
estimates are NA
, original flux value is
kept. flux
, st
and stp
(if not NULL) must have the same
length.
A vector with attributes varnames
and units
is
produced. varnames
value is set by name_out
argument.
units
value is extracted from flux
vector by
units
or set to default "-"
.
units
.
aa <- matrix(ncol = 3, nrow = 10, byrow = TRUE, c(-1, 1, 2),
dimnames = list(NULL, c("flux", "st", "stp")))
aa[c(4, 8, 9, 11, 15, 18, 22, 25, 27, 29)] <- NA
(aa <- as.data.frame(aa))
aa$flux_stc <- add_st(aa$flux, aa$st, aa$stp, "flux_stc")
aa
lapply(aa, attributes)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.