1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 11:11:54 +02:00

(v0.8.0.9034) add cid to antivirals

This commit is contained in:
2019-11-23 12:39:57 +01:00
parent 267320f15f
commit e53cc4990c
37 changed files with 460 additions and 449 deletions

View File

@ -57,6 +57,33 @@ for (i in 2:length(atc_groups)) {
antivirals <- rbind(antivirals, get_atc_table(atc_groups[i]))
}
# arrange on name, untibble it and save
# arrange on name, untibble it
antivirals <- antivirals %>% arrange(name) %>% as.data.frame(stringsAsFactors = FALSE)
# add PubChem Compound ID (cid) and their trade names - functions are in file to create `antibiotics` data set
CIDs <- get_CID(antivirals$name)
# these could not be found:
antivirals[is.na(CIDs),] %>% View()
# get brand names from PubChem
synonyms <- get_synonyms(CIDs)
synonyms <- lapply(synonyms,
function(x) {
if (length(x) == 0 | all(is.na(x))) {
""
} else {
x
}})
antivirals <- antivirals %>%
transmute(atc,
cid = CIDs,
name,
atc_group,
synonyms = unname(synonyms),
oral_ddd,
oral_units,
iv_ddd,
iv_units)
# save it
usethis::use_data(antivirals, overwrite = TRUE)