View source: R/process_numeric.r
process_ecotox_numerics | R Documentation |
character
to numeric
where relevant The function
search_ecotox()
returns fields
from the ECOTOX database as is. Many numeric values are stored in the database as
text. It is not uncommon that these text fields cannot be converted directly and need
some sanitising first. process_ecotox_numerics()
takes a data.frame
returned by
search_ecotox()
, locates numeric columns, represented by text, sanitises the text
and converts them to numerics.
process_ecotox_numerics(
x,
.fns = as_numeric_ecotox,
...,
add_units = FALSE,
.names = NULL
)
x |
A |
.fns |
Function to convert |
... |
Arguments passed to |
add_units |
A |
.names |
A 'glue' specification used to rename the numeric columns. By default
it is |
Returns a data.frame
in which the columns containing numeric information
is converted from the character format from the database to actual numerics.
Pepijn de Vries
Other ecotox-sanitisers:
as_date_ecotox()
,
as_numeric_ecotox()
,
as_unit_ecotox()
,
mixed_to_single_unit()
,
process_ecotox_dates()
,
process_ecotox_units()
if (check_ecotox_availability()) {
df <- search_ecotox(
list(
latin_name = list(
terms = c("Skeletonema", "Daphnia"),
method = "contains"
),
chemical_name = list(
terms = "benzene",
method = "exact"
)
), list_ecotox_fields("full"))
df_num <-
process_ecotox_numerics(df, add_units = TRUE, warn = FALSE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.