| Title: | Qualitative and Quantitative Assessment of Occupational Chemical Exposure Risk |
|---|---|
| Description: | Provides a unified toolkit for occupational chemical exposure risk assessment, implementing three internationally recognised methods end to end: the qualitative control-banding methods COSHH Essentials (UK Health and Safety Executive) and the method of the French National Research and Safety Institute (INRS), together with the quantitative statistical procedure of the UNE-EN 689 standard for comparing measured exposure levels against occupational exposure limits. Every step of each method, from hazard banding and exposure scoring to lognormal or normal distribution fitting, one-sided tolerance limits, and monitoring-interval recommendations, is implemented as a small, independently callable, and unit-tested function, so assessments are reproducible and auditable without depending on any graphical interface. Optional 'shiny' applications provide a guided, interactive workflow for occupational hygienists and health and safety practitioners who prefer not to write code. References: UK Health and Safety Executive (2003) <https://www.hse.gov.uk/coshh/essentials/index.htm>; Mallet, Pilorget and Berne (2013, ISBN:978-2-7389-2166-2) "Méthodologie d'évaluation simplifiée du risque chimique: un outil d'aide à la décision" INRS ND 2233; European Committee for Standardisation (2018) <https://www.en-standard.eu/bs-en-689-2018-workplace-exposure-measurement-of-exposure-by-inhalation-to-chemical-agents-strategy-for-testing-compliance-with-occupational-exposure-limit-values/>. |
| Authors: | Raúl Aguilar-Elena [aut, cre] (ORCID: <https://orcid.org/0000-0001-8656-8155>), Ana Delgado-Garcia [aut] (ORCID: <https://orcid.org/0009-0003-7079-5507>), Alejandro Guillem-Riquelme [aut] (ORCID: <https://orcid.org/0000-0002-6373-5237>) |
| Maintainer: | Raúl Aguilar-Elena <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-09-21 12:02:41 UTC |
| Source: | https://github.com/Aguilar-Elena/expoquimR |
Compares the boiling point of a substance with its process temperature
to assign a volatility class ("Low" / "Medium" / "High" in English,
"Baja" / "Media" / "Alta" in Spanish), following the thresholds of
the COSHH Essentials method.
coshh_classify_volatility(boiling_point, process_temp)coshh_classify_volatility(boiling_point, process_temp)
boiling_point |
Numeric. Boiling point of the substance, in degrees Celsius. |
process_temp |
Numeric. Temperature at which the substance is handled, in degrees Celsius. |
The active language is controlled by expoquimr_lang().
Character scalar: volatility class in the active language.
coshh_classify_volatility(boiling_point = 111, process_temp = 20) expoquimr_lang("es") coshh_classify_volatility(boiling_point = 111, process_temp = 20) expoquimr_lang("en")coshh_classify_volatility(boiling_point = 111, process_temp = 20) expoquimr_lang("es") coshh_classify_volatility(boiling_point = 111, process_temp = 20) expoquimr_lang("en")
Chains coshh_grade(), coshh_classify_volatility() (if applicable),
coshh_risk() and coshh_measures() to produce a complete result row
from the raw data of a substance. Designed to be called directly from code
(scripts, reports, purrr::pmap, vignettes) without going through the
Shiny application.
coshh_evaluate( name, phrases, quantity, is_liquid, boiling_point = NA_real_, process_temp = NA_real_, dustiness = NA_character_ )coshh_evaluate( name, phrases, quantity, is_liquid, boiling_point = NA_real_, process_temp = NA_real_, dustiness = NA_character_ )
name |
Character. Identifying name of the substance. |
phrases |
Character. H/R phrases; see |
quantity |
Character. Quantity class in the active language. |
is_liquid |
Logical. |
boiling_point, process_temp
|
Numeric. Required only if
|
dustiness |
Character. Required only if |
Output labels (volatility class, quantity class, control measures) are
returned in the active language; see expoquimr_lang().
A one-row data.frame with columns substance, phrases,
grade, volatility, quantity, risk and measures.
coshh_evaluate( name = "Toluene", phrases = "H315, H336", quantity = "Medium", is_liquid = TRUE, boiling_point = 111, process_temp = 20 )coshh_evaluate( name = "Toluene", phrases = "H315, H336", quantity = "Medium", is_liquid = TRUE, boiling_point = 111, process_temp = 20 )
Reads an Excel sheet with the format of the expoquimR COSHH template
(one row per substance) and returns the complete assessment of each
one by calling coshh_evaluate().
coshh_from_excel(path, sheet = "COSHH_datos")coshh_from_excel(path, sheet = "COSHH_datos")
path |
Character. Path to the |
sheet |
Character or integer. Name or number of the sheet that
contains the data (default |
A data.frame with one row per substance and the result
columns of coshh_evaluate().
# With the template included in the package: path <- system.file("plantillas", "plantilla_coshh.xlsx", package = "expoquimR") coshh_from_excel(path) # With your own file, simply pass its path: # coshh_from_excel("my_coshh_data.xlsx")# With the template included in the package: path <- system.file("plantillas", "plantilla_coshh.xlsx", package = "expoquimR") coshh_from_excel(path) # With your own file, simply pass its path: # coshh_from_excel("my_coshh_data.xlsx")
Looks up each risk phrase (R) or hazard phrase (H) in the COSHH Essentials hazard group assignment table (groups A to E) and returns the most unfavourable group found. Any phrase not listed explicitly in groups B-E is assigned to group A, following the default rule of the original method.
coshh_grade(phrases)coshh_grade(phrases)
phrases |
Character scalar containing one or more phrases separated
by commas, e.g. |
Character scalar with the group ("A" to "E"), or
NA_character_ if phrases is empty or NA.
coshh_grade("H315, H319") coshh_grade("R23/24/25")coshh_grade("H315, H319") coshh_grade("R23/24/25")
Get the recommended control measures for a COSHH risk level
coshh_measures(risk_level)coshh_measures(risk_level)
risk_level |
Integer or character. Risk level (1 to 4), as returned
by |
Character scalar with the recommended control measures in the
active language (see expoquimr_lang()), or NA_character_ if the
level is not defined.
coshh_measures(3) expoquimr_lang("es") coshh_measures(3) expoquimr_lang("en")coshh_measures(3) expoquimr_lang("es") coshh_measures(3) expoquimr_lang("en")
Queries the hazard x quantity x volatility matrix of the COSHH Essentials
method to obtain the potential risk level (1 to 4). Substances of grade
"E" (carcinogenic, mutagenic or similar) always receive the maximum
level, regardless of quantity or volatility.
coshh_risk(grade, quantity, volatility)coshh_risk(grade, quantity, volatility)
grade |
Character. Hazard group ( |
quantity |
Character. Quantity class in the active language. Use
|
volatility |
Character. Volatility class in the active language.
Use |
Integer with the risk level (1 to 4), or NA_integer_ if the
combination is not defined in the table or grade is NA.
coshh_risk(grade = "C", quantity = "Medium", volatility = "High") coshh_risk(grade = "E", quantity = "Small", volatility = "Low")coshh_risk(grade = "C", quantity = "Medium", volatility = "High") coshh_risk(grade = "E", quantity = "Small", volatility = "Low")
expoquimR supports English ("en", default) and Spanish ("es"). The
active language controls the language of function output messages, column
labels returned by high-level wrapper functions, and error/warning
messages. It does not affect the Shiny apps, which have their own
in-app language selector.
expoquimr_lang(lang = NULL)expoquimr_lang(lang = NULL)
lang |
Character. |
The active language is stored in a private package environment, not in
options(), so calling this function never alters the user's global R
session settings.
Invisibly returns the previously active language.
expoquimr_lang() # query current language old <- expoquimr_lang("es") # switch to Spanish, saving the previous value expoquimr_lang(old) # restore itexpoquimr_lang() # query current language old <- expoquimr_lang("es") # switch to Spanish, saving the previous value expoquimr_lang(old) # restore it
Renders a self-contained HTML report from the results of one or more assessment methods implemented in expoquimR. Each method section is included only when the corresponding argument is supplied. The report includes input data, result tables, density plots (UNE-EN 689), additive effect groups, and a citation block for the package.
expoquimr_report( coshh = NULL, inrs = NULL, une689 = NULL, evaluator = "", workplace = "", output = "expoquimr_report.html", lang = .expoquimR_state$lang, open = TRUE )expoquimr_report( coshh = NULL, inrs = NULL, une689 = NULL, evaluator = "", workplace = "", output = "expoquimr_report.html", lang = .expoquimR_state$lang, open = TRUE )
coshh |
A |
inrs |
A |
une689 |
A list returned by |
evaluator |
Character. Name of the person responsible for the
assessment. Displayed in the report header. Default |
workplace |
Character. Name or description of the workplace or
workstation assessed. Default |
output |
Character. Path and filename for the output HTML file.
Default |
lang |
Character. Language for the report body: |
open |
Logical. Whether to open the report in the default browser
after rendering. Default |
Invisibly returns the path to the generated HTML file.
# COSHH only res <- coshh_evaluate( name = "Toluene", phrases = "H315, H336", quantity = "Medium", is_liquid = TRUE, boiling_point = 111, process_temp = 20 ) out1 <- tempfile(fileext = ".html") expoquimr_report( coshh = res, evaluator = "Dr. Jane Smith", workplace = "Printing workshop A", output = out1, open = FALSE ) # All three methods path <- system.file("plantillas", "plantilla_une689.xlsx", package = "expoquimR") res_une <- une689_from_excel(path) out2 <- tempfile(fileext = ".html") expoquimr_report( coshh = res, une689 = res_une, evaluator = "Dr. Jane Smith", workplace = "Printing workshop A", output = out2, lang = "en", open = FALSE )# COSHH only res <- coshh_evaluate( name = "Toluene", phrases = "H315, H336", quantity = "Medium", is_liquid = TRUE, boiling_point = 111, process_temp = 20 ) out1 <- tempfile(fileext = ".html") expoquimr_report( coshh = res, evaluator = "Dr. Jane Smith", workplace = "Printing workshop A", output = out1, open = FALSE ) # All three methods path <- system.file("plantillas", "plantilla_une689.xlsx", package = "expoquimR") res_une <- une689_from_excel(path) out2 <- tempfile(fileext = ".html") expoquimr_report( coshh = res, une689 = res_une, evaluator = "Dr. Jane Smith", workplace = "Printing workshop A", output = out2, lang = "en", open = FALSE )
Collective protection class and score (INRS method)
inrs_collective_protection(situation)inrs_collective_protection(situation)
situation |
Character. One of the situations of INRS Figure 4,
e.g. |
A one-row data.frame with columns class and score.
inrs_collective_protection("Enclosing hood / full enclosure")inrs_collective_protection("Enclosing hood / full enclosure")
Chains all the steps of the INRS method (hazard class, quantity, frequency, potential exposure, potential risk, volatility or dustiness, process and collective protection) from the raw data of a product, and returns a complete result row. Designed to be used directly from code, without going through the Shiny application.
inrs_evaluate( name, r_phrases = character(0), h_phrases = character(0), process = NULL, vla = NA_real_, quantity_value = NA_real_, quantity_unit = c("g", "ml", "kg", "l"), frequency_value = NA_real_, frequency_unit = c("minutes", "hours", "days", "months", "not_used"), substance_type = c("liquid", "solid"), liquid_method = c("graph", "pressure"), use_temperature = NA_real_, boiling_point = NA_real_, vapour_pressure = NA_real_, solid_description = NA_character_, procedure, protection )inrs_evaluate( name, r_phrases = character(0), h_phrases = character(0), process = NULL, vla = NA_real_, quantity_value = NA_real_, quantity_unit = c("g", "ml", "kg", "l"), frequency_value = NA_real_, frequency_unit = c("minutes", "hours", "days", "months", "not_used"), substance_type = c("liquid", "solid"), liquid_method = c("graph", "pressure"), use_temperature = NA_real_, boiling_point = NA_real_, vapour_pressure = NA_real_, solid_description = NA_character_, procedure, protection )
name |
Character. Name of the product. |
r_phrases, h_phrases
|
Character vectors. See |
process |
Character. See |
vla |
Numeric. VLA in mg/m3. |
quantity_value, quantity_unit
|
|
frequency_value, frequency_unit
|
|
substance_type |
Character. |
liquid_method |
Character. |
use_temperature, boiling_point
|
Numeric. Only if
|
vapour_pressure |
Numeric. Only if |
solid_description |
Character. Only if |
procedure |
Character. See |
protection |
Character. See |
A one-row data.frame with all the intermediate classes and
scores, the final inhalation risk score and its characterisation.
inrs_evaluate( name = "Solvent X", h_phrases = "H336", vla = 50, quantity_value = 5, quantity_unit = "l", frequency_value = 3, frequency_unit = "hours", substance_type = "liquid", liquid_method = "graph", use_temperature = 40, boiling_point = 80, procedure = "Open", protection = "Moderate dispersion conditions" )inrs_evaluate( name = "Solvent X", h_phrases = "H336", vla = 50, quantity_value = 5, quantity_unit = "l", frequency_value = 3, frequency_unit = "hours", substance_type = "liquid", liquid_method = "graph", use_temperature = 40, boiling_point = 80, procedure = "Open", protection = "Moderate dispersion conditions" )
Converts the given frequency of use to the reference units of Table 3 of the INRS method (hours/day or days/month or days/year, depending on the input unit) and returns the corresponding class (0 to 4).
inrs_frequency_class( value = NA_real_, unit = c("minutes", "hours", "days", "months", "not_used") )inrs_frequency_class( value = NA_real_, unit = c("minutes", "hours", "days", "months", "not_used") )
value |
Numeric. Frequency value. Ignored if |
unit |
Character. One of |
Character scalar ("0" to "4"), or NA_character_ if there
is no match in the reference table.
inrs_frequency_class(3, "hours") inrs_frequency_class(unit = "not_used")inrs_frequency_class(3, "hours") inrs_frequency_class(unit = "not_used")
Reads an Excel sheet with the format of the expoquimR INRS template
(one row per product) and returns the complete assessment by calling
inrs_evaluate().
inrs_from_excel(path, sheet = "INRS_datos")inrs_from_excel(path, sheet = "INRS_datos")
path |
Character. Path to the |
sheet |
Character or integer. Name or number of the sheet
(default |
A data.frame with one row per product and all the result
columns of inrs_evaluate().
path <- system.file("plantillas", "plantilla_inrs.xlsx", package = "expoquimR") inrs_from_excel(path)path <- system.file("plantillas", "plantilla_inrs.xlsx", package = "expoquimR") inrs_from_excel(path)
Determines the hazard class (1 to 5) of a substance from its R phrases, its H phrases, its VLA, or the material/process it belongs to, by consulting Table 1 of the INRS method. It is explored from the most hazardous class (5) down to the least hazardous (1), and the first class with a match is returned. If no phrase, VLA or process matches classes 2 to 5, class 1 is assigned by default (catch-all: "has phrases but none of the above"), as established by the INRS methodology.
inrs_hazard_class( r_phrases = character(0), h_phrases = character(0), process = NULL, vla = NA_real_ )inrs_hazard_class( r_phrases = character(0), h_phrases = character(0), process = NULL, vla = NA_real_ )
r_phrases |
Character vector of R phrases (optional). |
h_phrases |
Character vector of H phrases (optional). |
process |
Character scalar with the material/process (optional). Compared as a substring (case-insensitive) against the text of Table 1. |
vla |
Numeric. VLA in mg/m3 (optional). |
Character scalar ("1" to "5"). Only returns
NA_character_ if no criterion at all was supplied (r_phrases,
h_phrases, process and vla all empty/NA), in which case there
is not enough information to classify.
inrs_hazard_class(h_phrases = "H335") inrs_hazard_class(vla = 0.05) inrs_hazard_class(vla = 200) # falls into class 1 by defaultinrs_hazard_class(h_phrases = "H335") inrs_hazard_class(vla = 0.05) inrs_hazard_class(vla = 200) # falls into class 1 by default
Product of the five partial scores of the INRS method.
inrs_inhalation_risk( potential_risk_score, volatility_score, procedure_score, protection_score, vla_correction_factor )inrs_inhalation_risk( potential_risk_score, volatility_score, procedure_score, protection_score, vla_correction_factor )
potential_risk_score |
Numeric. See |
volatility_score |
Numeric. See |
procedure_score |
Numeric. See |
protection_score |
Numeric. See |
vla_correction_factor |
Numeric. See |
Numeric, or NA_real_ if any component is missing.
inrs_inhalation_risk(100, 10, 0.5, 0.7, 10)inrs_inhalation_risk(100, 10, 0.5, 0.7, 10)
Classifies the volatility of a liquid by comparing its boiling point with the two class-separating lines of the INRS method graph (Figure 2, use temperature on the X axis, boiling point on the Y axis).
inrs_liquid_volatility_graph(use_temperature, boiling_point)inrs_liquid_volatility_graph(use_temperature, boiling_point)
use_temperature |
Numeric. Use (process) temperature, in degrees Celsius. Corresponds to the X axis of the graph. |
boiling_point |
Numeric. Boiling point, in degrees Celsius. Corresponds to the Y axis of the graph. |
Character scalar ("1" low, "2" medium, "3" high).
inrs_liquid_volatility_graph(use_temperature = 20, boiling_point = 200) inrs_liquid_volatility_graph(use_temperature = 20, boiling_point = 80)inrs_liquid_volatility_graph(use_temperature = 20, boiling_point = 200) inrs_liquid_volatility_graph(use_temperature = 20, boiling_point = 80)
Classifies the volatility of a liquid according to the official thresholds of Table 8 of the INRS method.
inrs_liquid_volatility_pressure(vapour_pressure)inrs_liquid_volatility_pressure(vapour_pressure)
vapour_pressure |
Numeric. Vapour pressure at working temperature, in kPa. |
Character scalar ("1" if Pv < 0.5 kPa, "2" if
0.5 <= Pv < 25 kPa, "3" if Pv >= 25 kPa).
inrs_liquid_volatility_pressure(15)inrs_liquid_volatility_pressure(15)
VLA correction factor (INRS method)
inrs_oel_correction_factor(vla)inrs_oel_correction_factor(vla)
vla |
Numeric. VLA in mg/m3. |
Numeric (1, 10, 30 or 100), or NA_real_ if vla is NA.
inrs_oel_correction_factor(0.05)inrs_oel_correction_factor(0.05)
Consults Table 4 of the INRS method (quantity class x frequency class) to obtain the potential exposure class.
inrs_potential_exposure_class(quantity_class, frequency_class)inrs_potential_exposure_class(quantity_class, frequency_class)
quantity_class |
Character. See |
frequency_class |
Character. See |
Character scalar ("0" to "5"), or NA_character_ if the
combination is not defined.
inrs_potential_exposure_class("3", "2")inrs_potential_exposure_class("3", "2")
Consults Table 5 of the INRS method (potential exposure class x hazard class) to obtain the potential risk class.
inrs_potential_risk_class(potential_exposure_class, hazard_class)inrs_potential_risk_class(potential_exposure_class, hazard_class)
potential_exposure_class |
Character. See
|
hazard_class |
Character. See |
Character scalar ("1" to "5"), or NA_character_ if the
combination is not defined.
inrs_potential_risk_class("4", "3")inrs_potential_risk_class("4", "3")
Potential risk score (INRS method)
inrs_potential_risk_score(potential_risk_class)inrs_potential_risk_score(potential_risk_class)
potential_risk_class |
Character. See |
Numeric (1, 10, 100, 1000 or 10000), or NA_real_.
inrs_potential_risk_score("3")inrs_potential_risk_score("3")
Process class and score (INRS method)
inrs_process_type(type)inrs_process_type(type)
type |
Character. One of |
A one-row data.frame with columns class and score.
inrs_process_type("Open")inrs_process_type("Open")
Classifies the daily quantity of substance handled into one of the 5 classes of the INRS method, according to its unit.
inrs_quantity_class(value, unit = c("g", "ml", "kg", "l"))inrs_quantity_class(value, unit = c("g", "ml", "kg", "l"))
value |
Numeric. Daily quantity handled. |
unit |
Character. One of |
Character scalar ("1" to "5"), or NA_character_ if
value is NA.
inrs_quantity_class(50, "g") inrs_quantity_class(500, "kg")inrs_quantity_class(50, "g") inrs_quantity_class(500, "kg")
Inhalation risk characterisation (INRS method)
inrs_risk_characterisation(inhalation_risk)inrs_risk_characterisation(inhalation_risk)
inhalation_risk |
Numeric. See |
Character scalar describing the action priority, or
NA_character_ if inhalation_risk is NA.
inrs_risk_characterisation(2500)inrs_risk_characterisation(2500)
Dustiness class of a solid (INRS method)
inrs_solid_dustiness(description)inrs_solid_dustiness(description)
description |
Character. One of |
Character scalar ("1" to "3"), or NA_character_ if
description does not match any valid option.
inrs_solid_dustiness("Fine dust with little visible dispersion")inrs_solid_dustiness("Fine dust with little visible dispersion")
Volatility or dustiness score (INRS method)
inrs_volatility_score(volatility_class)inrs_volatility_score(volatility_class)
volatility_class |
Character. |
Numeric (1, 10 or 100), or NA_real_.
inrs_volatility_score("2")inrs_volatility_score("2")
Launch the COSHH Essentials Shiny application
run_coshh(...)run_coshh(...)
... |
Additional arguments passed to |
No return value, called for side effects. Launches a Shiny application in the default browser.
run_coshh()run_coshh()
Launch the INRS method Shiny application
run_inrs(...)run_inrs(...)
... |
Additional arguments passed to |
No return value, called for side effects. Launches a Shiny application in the default browser.
run_inrs()run_inrs()
Launch the UNE-EN 689 Shiny application (preliminary, statistical and periodic assessment)
run_une689(...)run_une689(...)
... |
Additional arguments passed to |
No return value, called for side effects. Launches a Shiny application in the default browser.
run_une689()run_une689()
From the exposure indices (IE) of all the days evaluated, determines whether exposure is conforming, non-conforming, or whether no decision can be made without further measurements, following the criteria of the UNE-EN 689 preliminary assessment.
une689_classify_conformity(ie)une689_classify_conformity(ie)
ie |
Numeric vector. Exposure indices, one per day (see
|
Character scalar: .t("une689_conformity") if all IE values
are below 0.1; .t("une689_no_conformity") if any IE is above 1;
.t("une689_no_decision") if any IE is between 0.1 and 1 (both
inclusive) and none exceeds 1. Returns NA_character_ if there is
no valid IE at all (not enough data to classify).
In the original Shiny app, if all days had IE = NA (due to missing
data), the check all(IEs < 0.1, na.rm = TRUE) returned TRUE
(because all() over an empty vector is TRUE in R), and the result
was incorrectly reported as .t("une689_conformity") with no actual
data. This function fixes that case by returning NA_character_ (not
enough data) instead of a false conformity. This change is flagged
here because, unlike the INRS points, it was applied without prior
confirmation: reporting "conformity" with no data is a safety flaw,
not a methodological judgement call.
une689_classify_conformity(c(0.02)) une689_classify_conformity(c(1, 0.9, 0.56)) une689_classify_conformity(c(1.2, 0.05))une689_classify_conformity(c(0.02)) une689_classify_conformity(c(1, 0.9, 0.56)) une689_classify_conformity(c(1.2, 0.05))
Calculates the daily exposure from the concentrations and times of the
valid samples of a measurement day. If there is a single valid sample
taken over the complete 8-hour working day, the ED is directly that
concentration. Otherwise, it is calculated as the time-weighted
average over an 8-hour day (sum(concentration * time) / 8).
une689_daily_exposure(concentration, time)une689_daily_exposure(concentration, time)
concentration |
Numeric vector. Measured concentrations (mg/m3), one per sample. |
time |
Numeric vector. Time of each sample (hours), same length
as |
Numeric scalar with the ED, or NA_real_ if there is no valid
(concentration, time) pair.
une689_daily_exposure(concentration = c(12, 8), time = c(4, 4)) une689_daily_exposure(concentration = 9, time = 8)une689_daily_exposure(concentration = c(12, 8), time = c(4, 4)) une689_daily_exposure(concentration = 9, time = 8)
Decides whether the data best fits a lognormal, normal, or neither distribution, from the Shapiro-Wilk p-values. Priority is given to the lognormal fit, following common practice in industrial hygiene (exposure is usually lognormal).
une689_distribution_type(pval_normal, pval_lognormal, alpha = 0.05)une689_distribution_type(pval_normal, pval_lognormal, alpha = 0.05)
pval_normal |
Numeric. p-value of the normality test on ED. |
pval_lognormal |
Numeric. p-value of the normality test on log(ED). |
alpha |
Numeric. Significance level (default 0.05). |
Character scalar: one of "Lognormal", "Normal" or
"Neither" (in English, the default), or the equivalent Spanish
labels when expoquimr_lang("es") is active.
une689_distribution_type(pval_normal = 0.03, pval_lognormal = 0.20)une689_distribution_type(pval_normal = 0.03, pval_lognormal = 0.20)
Calculates the ED and IE for each day and classifies the overall conformity, from a set of samples organised by measurement day. Designed to be used directly from code, without going through the Shiny application.
une689_evaluate_preliminary(data, vla)une689_evaluate_preliminary(data, vla)
data |
A |
vla |
Numeric. Valor Limite Ambiental / occupational exposure limit (mg/m3). |
A list with two elements:
days_tableA data.frame with columns day, ED and
IE, one row per day.
resultCharacter scalar with the overall classification,
see une689_classify_conformity().
data <- data.frame( day = c(1, 1, 2, 3, 3), concentration = c(12, 8, 9, 5, 6), time = c(4, 4, 8, 3, 5) ) une689_evaluate_preliminary(data, vla = 10)data <- data.frame( day = c(1, 1, 2, 3, 3), concentration = c(12, 8, 9, 5, 6), time = c(4, 4, 8, 3, 5) ) une689_evaluate_preliminary(data, vla = 10)
Chains the distribution fit, the calculation of UT, LSC(95,70), UR and the statistical conformity from a set of daily exposure (ED) values. Designed to be used directly from code, without going through the Shiny application.
une689_evaluate_statistical(ed, vla)une689_evaluate_statistical(ed, vla)
ed |
Numeric vector. ED values (one per day), all positive. A
minimum of 6 is required (see |
vla |
Numeric. Valor Limite Ambiental / occupational exposure limit (mg/m3). |
A list with elements n, distribution_type, MA, DS,
MG, DSG, W_normal, pval_normal, W_lognormal,
pval_lognormal, ut, lsc, ur, conformity.
une689_evaluate_statistical(c(5, 6, 7, 8, 9, 10), vla = 10)une689_evaluate_statistical(c(5, 6, 7, 8, 9, 10), vla = 10)
Exposure index (IE) for a measurement day, per UNE-EN 689
une689_exposure_index(ed, vla)une689_exposure_index(ed, vla)
ed |
Numeric. Daily exposure, see |
vla |
Numeric. Valor Limite Ambiental / occupational exposure limit (mg/m3). |
Numeric scalar (ed / vla), or NA_real_ if ed or vla are
not valid (vla must be > 0).
une689_exposure_index(ed = 9, vla = 10)une689_exposure_index(ed = 9, vla = 10)
Reads the three sheets of the expoquimR UNE-EN 689 template
(Agents, Measurements and optionally Additive_effects) and
returns a list with the preliminary assessment of each agent, and if
applicable, the additive effects calculation by group.
une689_from_excel(path)une689_from_excel(path)
path |
Character. Path to the |
A list with the elements:
preliminaryA list with one element per agent, each with
name, vla, days_table and result.
additivedata.frame with columns group, agent,
mean_ie and combined_ie, or NULL if there is no additive
effects sheet.
path <- system.file("plantillas", "plantilla_une689.xlsx", package = "expoquimR") res <- une689_from_excel(path) res$preliminary res$additivepath <- system.file("plantillas", "plantilla_une689.xlsx", package = "expoquimR") res <- une689_from_excel(path) res$preliminary res$additive
Upper confidence limit LSC(95,70) (UNE-EN 689)
une689_lsc( distribution_type, ut, MA = NA_real_, DS = NA_real_, MG = NA_real_, DSG = NA_real_ )une689_lsc( distribution_type, ut, MA = NA_real_, DS = NA_real_, MG = NA_real_, DSG = NA_real_ )
distribution_type |
Character. Distribution type as returned by
|
ut |
Numeric. UT factor, see |
MA, DS
|
Numeric. Arithmetic mean and standard deviation (only
needed when |
MG, DSG
|
Numeric. Geometric mean and standard deviation (only
needed when |
Numeric scalar with the LSC(95,70), or NA_real_ if
distribution_type = "Neither" (or "Ninguna" in Spanish).
une689_lsc("Normal", ut = 2.005, MA = 7.5, DS = 1.87)une689_lsc("Normal", ut = 2.005, MA = 7.5, DS = 1.87)
Recommended monitoring interval, option 1 (MG or MA vs VLA)
une689_monitoring_interval_opt1(reference_value, vla)une689_monitoring_interval_opt1(reference_value, vla)
reference_value |
Numeric. MG if the distribution is lognormal,
or MA if normal (see |
vla |
Numeric. Valor Limite Ambiental / occupational exposure limit (mg/m3). |
Character scalar describing the recommended monitoring interval, in months.
une689_monitoring_interval_opt1(reference_value = 0.8, vla = 10)une689_monitoring_interval_opt1(reference_value = 0.8, vla = 10)
Recommended monitoring interval, option 2 (LSC95,70 vs VLA)
une689_monitoring_interval_opt2(lsc, vla)une689_monitoring_interval_opt2(lsc, vla)
lsc |
Numeric. LSC(95,70), see |
vla |
Numeric. Valor Limite Ambiental / occupational exposure limit (mg/m3). |
Character scalar describing the recommended monitoring interval, in months, or a warning that exposure must be reviewed.
une689_monitoring_interval_opt2(lsc = 4, vla = 10)une689_monitoring_interval_opt2(lsc = 4, vla = 10)
Applies the Shapiro-Wilk test to the ED values (to test normality) and to their logarithm (to test lognormality).
une689_normality_test(ed)une689_normality_test(ed)
ed |
Numeric vector. Daily exposure (ED) values, all strictly
positive. At least 3 values are required (minimum required by
|
A list with elements W_normal, pval_normal, W_lognormal,
pval_lognormal.
une689_normality_test(c(5, 6, 7, 8, 9, 10))une689_normality_test(c(5, 6, 7, 8, 9, 10))
Conformity of the statistical assessment (UNE-EN 689)
une689_statistical_conformity(ur, ut)une689_statistical_conformity(ur, ut)
ur |
Numeric. One-sided risk index, see |
ut |
Numeric. UT factor, see |
Character scalar: "CONFORMITY" if ur >= ut,
"NON-CONFORMITY" if ur < ut, or NA_character_ if ur is NA
(e.g. when neither the normal nor the lognormal fit is adequate).
Labels are returned in the active language; see expoquimr_lang().
une689_statistical_conformity(ur = 2.1, ut = 2.005)une689_statistical_conformity(ur = 2.1, ut = 2.005)
Calculates the arithmetic mean and standard deviation (MA, DS) and the geometric mean and standard deviation (MG, DSG) of a set of daily exposure (ED) values, needed to test the normal and lognormal fits.
une689_statistics(ed)une689_statistics(ed)
ed |
Numeric vector. Daily exposure (ED) values, all strictly positive. |
A list with elements MA, DS, MG, DSG.
une689_statistics(c(5, 6, 7, 8, 9, 10))une689_statistics(c(5, 6, 7, 8, 9, 10))
One-sided risk index UR (UNE-EN 689)
une689_ur( distribution_type, vla, MA = NA_real_, DS = NA_real_, MG = NA_real_, DSG = NA_real_ )une689_ur( distribution_type, vla, MA = NA_real_, DS = NA_real_, MG = NA_real_, DSG = NA_real_ )
distribution_type |
Character. Distribution type; see |
vla |
Numeric. Valor Limite Ambiental / occupational exposure limit (mg/m3). |
MA, DS, MG, DSG
|
Numeric. See |
Numeric scalar, or NA_real_ if distribution_type = "Neither".
une689_ur("Normal", vla = 10, MA = 7.5, DS = 1.87)une689_ur("Normal", vla = 10, MA = 7.5, DS = 1.87)
Looks up the one-sided tolerance factor (UT) tabulated by UNE-EN 689
for a number of days n between 6 and 30. For n > 30 the limit
value 1.820 is used, as established by the standard.
une689_ut(n)une689_ut(n)
n |
Integer. Number of days (ED measurements) used in the
statistical assessment. Must be |
Numeric scalar with the UT value, or NA_real_ if n < 6.
une689_ut(6) une689_ut(50)une689_ut(6) une689_ut(50)
The UNE-EN 689 preliminary assessment requires a minimum number of evaluated days (usually 3). Helper function to validate this before calculating, both from code and from the Shiny app.
une689_validate_min_days(n_days, minimum = 3L)une689_validate_min_days(n_days, minimum = 3L)
n_days |
Integer. Number of days with data entered. |
minimum |
Integer. Minimum number required (default 3). |
Logical: TRUE if n_days >= minimum.
une689_validate_min_days(2) une689_validate_min_days(3)une689_validate_min_days(2) une689_validate_min_days(3)