Skip to contents

This function composes a list of JECFA chemicals.

Usage

compose_jecfa_list(jecfa_id)

Arguments

jecfa_id

(int) The index of the chemical in the JECFA database.

Value

A list with two elements: result and error. The result is a tibble with the chemical information. The error is NULL if the function runs successfully; otherwise, it contains the error message, and result is NULL.

Examples

compose_jecfa_list(1) # success
#> $result
#> # A tibble: 1 × 23
#>   ADI1          ADI_sourcelink1 Meeting1 Meeting_sourcelink1 `Specs Code1`
#>   <chr>         <chr>           <chr>    <chr>               <chr>        
#> 1 NOT SPECIFIED NA              33       NA                  R            
#> # ℹ 18 more variables: `Specs Code_sourcelink1` <chr>, Report1 <chr>,
#> #   Report_sourcelink1 <chr>, `Tox Monograph1` <chr>,
#> #   `Tox Monograph_sourcelink1` <chr>, Specification1 <chr>,
#> #   Specification_sourcelink1 <chr>, `Previous Years1` <chr>,
#> #   `Previous Years_sourcelink1` <chr>, Synonyms <chr>, `CAS number` <chr>,
#> #   INS <chr>, `Functional Class` <chr>, `INS matches` <chr>,
#> #   `Evaluation year1` <chr>, JECFA_name <chr>, index <dbl>, URL <chr>
#> 
#> $error
#> NULL
#> 
compose_jecfa_list("a") # failure
#> <simpleError in open.connection(x, "rb"): HTTP error 500.>
#> $result
#> NULL
#> 
#> $error
#> <simpleError in open.connection(x, "rb"): HTTP error 500.>
#>