screen_drug {vigicaen}R Documentation

Screening of Drugs

Description

[Experimental] The screen_drug() function identifies and ranks the most frequently reported drugs (by active ingredient) in a dataset.

Usage

screen_drug(.data, mp_data, freq_threshold = NULL, top_n = NULL)

Arguments

.data

An drug data.table. See drug_

mp_data

An MP data.table. See mp_

freq_threshold

A numeric value indicating the minimum frequency (as a proportion) of cases where a drug must appear to be included in the results. Defaults to NULL.

top_n

An integer specifying the number of most frequently occurring drugs to return. Defaults to NULL.

Details

Value

A data.frame with the following columns:

The results are sorted in descending order of percentage.

Examples

# Set up start
data.table::setDTthreads(1)

# Filter drugs appearing in at least 10% of reports
screen_drug(
  .data = drug_,
  mp_data = mp_,
  freq_threshold = 0.10
)

# Get the top 5 most reported drugs
screen_drug(
  .data = drug_,
  mp_data = mp_,
  top_n = 5
)

# nb: in the example datasets, not all drugs are recorded in mp_,
# leading to NAs in screen_drug output.

# Set up end
data.table::setDTthreads(0)

[Package vigicaen version 0.15.6 Index]