Skip to contents

Compose URL to TRS PDF for a JECFA report. Valid URLs are constructed based on the JECFA data frame information, i.e, they should report "NOT FAS" or "NOT PREPARED" in the Tox_monograph_abbr column and have a valid URL in the Report_sourcelink column.

Usage

compose_url(id, db)

Arguments

id

JECFA ref_id

db

JECFA data frame

Value

a list with the URL, the filename with the ID and the filename without the ID

Examples

library(jecfa)

jecfa_sample <- c(1, 10) |>
  purrr::map(\(id) compose_jecfa_list(id) |> get_result()) |>
  create_df() |>
  process_df() |>
  add_metadata()

jecfa_sample[["ref_id"]][[1]] |> # report 1 has no TRS PDF
  compose_url(jecfa_sample)
#> Warning: Condition not satisfied, skipping...
#> NULL

jecfa_sample[["ref_id"]][[2]] |> # report 10 has a TRS PDF
  compose_url(jecfa_sample)
#> $url
#> [1] "http://apps.who.int/iris/bitstream/10665/41962/1/WHO_TRS_868.pdf"
#> 
#> $fnm
#> 2-TRS_868.pdf
#> 
#> $fnm_noid
#> TRS_868.pdf
#>