Description Usage Arguments Details Value References See Also Examples

View source: R/zerotreatment.R

A function to automatically replace rounded zeroes/BDLs in a composition.

1 2 | ```
zeroreplace(x,d=NULL,a=2/3)
``` |

`x` |
composition or dataset of compositions |

`d` |
vector containing the detection limits of each part |

`a` |
fraction of the detection limit to be used in replacement |

If `d`

is given, zeroes from each column of `x`

are replaced by the
corresponding detection limit contained there, scaled
down by the value of `a`

(usually a scalar, although if
it is a vector it will be recycled with a warning). The variable `d`

should
be a vector of length equal to `ncol(x)`

or a matrix of the same shape as `x`

.

If `d=NULL`

, then the detection limit is extracted from the data set,
if it is available there (i.e., if there are negative numbers). If no negative
number is present in the data set, and no value is given for `d`

, the
result will be equal to `x`

. See `compositions.missings`

for more
details on the missing policy.

an object of the same class as `x`

, where all WZERO values have been replaced.
Output contains a further attribute (named `Losts`

),
with a logical array of the same dimensions as `x`

,
showing which elements were replaced (TRUE) and which were
kept unchanged (FALSE).

Aitchison, J. (1986) *The Statistical Analysis of Compositional
Data* Monographs on Statistics and Applied Probability. Chapman &
Hall Ltd., London (UK). 416p.

Mart\'in-Fern\'andez, J.A.; Barcel\'o-Vidal, C. and Pawlowsky-Glahn, V. (2003)
Dealing With Zeros and Missing Values in Compositional Data Sets
Using Nonparametric Imputation. *Mathematical Geology*, 35 , 253-278

http://ima.udg.es/Activitats/CoDaWork03

http://ima.udg.es/Activitats/CoDaWork05

`compositions.missings`

,`getDetectionlimit`

1 2 3 4 5 6 | ```
data(SimulatedAmounts)
x <- acomp(sa.lognormals)
xnew <- simulateMissings(x,dl=0.05,knownlimit=FALSE)
xnew
xrep <- zeroreplace(xnew,0.05)
xrep
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.