dbparser (version 1.0.3)

parse_drug_dosages: Extracts the drug dosages element and return data as tibble.

Description

parse_drug_dosages returns tibble of drug dosages elements.

Usage

parse_drug_dosages(save_table = FALSE, save_csv = FALSE,
  csv_path = ".", override_csv = FALSE)

Arguments

save_table

boolean, save table in database if true.

save_csv

boolean, save csv version of parsed dataframe if true

csv_path

location to save csv files into it, default is current location, save_csv must be true

override_csv

override existing csv, if any, in case it is true in the new parse operation

Value

drug dosages node attributes tibble

Details

This functions extracts the dosages element of drug node in drugbank xml database with the option to save it in a predefined database via open_db method. It takes one single optional argument to save the returned tibble in the database. It must be called after get_xml_db_rows function like any other parser function. If get_xml_db_rows is called before for any reason, so no need to call it again before calling this function.

Examples

Run this code
# NOT RUN {
# return only the parsed dataframe
parse_drug_dosages()

# save in database and return parsed dataframe
parse_drug_dosages(save_table = TRUE)

# save parsed dataframe as csv if it does not exist in current location
# and return parsed dataframe.
# If the csv exist before read it and return its data.
parse_drug_dosages(save_csv = TRUE)

# save in database, save parsed dataframe as csv if it does not exist
# in current location and return parsed dataframe.
# If the csv exist before read it and return its data.
parse_drug_dosages(ssave_table = TRUE, save_csv = TRUE)

# save parsed dataframe as csv if it does not exist in given location
#  and return parsed dataframe.
# If the csv exist before read it and return its data.
parse_drug_dosages(save_csv = TRUE, csv_path = TRUE)

# save parsed dataframe as csv if it does not exist in current
# location and return parsed dataframe.
# If the csv exist override it and return it.
parse_drug_dosages(save_csv = TRUE, csv_path = TRUE, override = TRUE)
# }

Run the code above in your browser using DataLab