as_unit_ecotox {ECOTOXr}R Documentation

Text from the ECOTOX database to mixed_units

Description

[Experimental] Convert text to units after sanitising.

Usage

as_unit_ecotox(
  x,
  type = c("concentration", "duration", "length", "media", "application", "size",
    "weight", "unknown"),
  ...,
  warn = TRUE
)

Arguments

x

A vector of character strings. It expects fields as commonly returned from the ECOTOX database.

type

The type of unit that can help the sanitation process. See the 'usage' section for available options. These options are linked to the different unit tables in the database (see vignette("ecotox-schema")). It can help to interpret ambiguous units correctly. For instance, 'dpm' can both mean 'disintegrations per minute' (type = "concentration") and 'days post-moult' (type = "duration").

...

Ignored.

warn

If set to FALSE warnings while converting text to units are suppressed.

Details

The following steps are performed (in the order as listed) to sanitise text before coercing it to units:

It is your own responsibility to check if the sanitising steps are appropriate for your analyses.

Value

A vector of ?units::unit class objects with the same length as x.

Author(s)

Pepijn de Vries

See Also

Other ecotox-sanitisers: as_date_ecotox(), as_numeric_ecotox(), mixed_to_single_unit(), process_ecotox_dates(), process_ecotox_numerics(), process_ecotox_units()

Examples

## Try parsing a random set of units from the database:
c("ppm-d", "ml/2.5 cm eu", "fl oz/10 gal/1k sqft", "kg/100 L",
  "mopm", "ng/kg", "ug", "AI ng/g", "PH", "pm", "uM/cm3", "1e-4 mM",
  "degree", "fs", "mg/TI", "RR", "ug/g org/d", "1e+4 IU/TI", "pg/mg TE",
  "pmol/mg", "1e-9/l", "no >15 cm", "umol/mg pro", "cc/org/wk", "PIg/L",
  "ug/100 ul/org", "ae mg/kg diet/d", "umol/mg/h", "cmol/kg d soil",
  "ug/L diet", "kg/100 kg sd", "1e+6 cells", "ul diet", "S", "mmol/h/g TI",
  "g/70 d", "vg", "ng/200 mg diet", "uS/cm2", "AI ml/ha", "AI pt/acre",
  "mg P/h/g TI", "no/m", "kg/ton sd", "ug/g wet wt", "AI mg/2 L diet",
  "nmol/TI", "umol/g wet wt", "PSU", "Wijs number") |>
  as_unit_ecotox(warn = FALSE)

## Adding the type of measurement can affect interpretation:
as_unit_ecotox(c("C", "K"), type = "concentration")
as_unit_ecotox(c("C", "K"), type = "media")

[Package ECOTOXr version 1.2.1 Index]