add_adr | R Documentation |
Creates adr columns
in vigibase datasets (demo, link, drug, but also adr).
add_adr(
.data,
a_code,
a_names = names(a_code),
adr_data,
data_type = deprecated()
)
.data |
The dataset to update (demo, link, drug, adr). |
a_code |
A named list of low level terms codes (llt_codes). |
a_names |
A character vector. Names for adr columns (must be the
same length as adr_list), default to |
adr_data |
A data.frame containing the adr data (usually, it is |
data_type |
Low-level term codes are the preferred level of requesting in
Vigibase extract case level since they capture all possible codes for a given
Preferred Term. Collect low-level terms with get_llt_soc()
and
get_llt_smq()
. You can add adr identification to a demo
, a link
, drug
or even an adr
dataset (in this latter case, you must provide adr
twice,
as .data
and adr_data
). Column names of these dataset should not have been
modified from the original vigibase dataset (as created with tb_vigibase()
).
A dataset with the new adr columns.
Each element of a_names
will add a column with the same name in .data
.
The value can be 0 (the corresponding adr is absent)
or 1 (the adr is present in the case if .data
is demo
or drug
,
or "this row correspond to this adr", if .data
is adr
or link
).
add_drug()
, get_llt_soc()
, get_llt_smq()
# create adr_colitis, adr_embolism and adr_pneumonitis columns in demo
# be careful, this example may overwrite your own demo dataset
demo <- demo_
a_pt_sel <- ex_$pt_sel
adr <- adr_
a_llt <-
get_llt_soc(
term_sel = a_pt_sel,
term_level = "pt",
meddra = meddra_
)
demo <-
demo |>
add_adr(
a_code = a_llt,
adr_data = adr
)
demo |>
check_dm(names(a_pt_sel))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.