dbparser (version 1.0.3)

parse_drug_prices: Extracts the drug prices element and return data as data frame.

Description

parse_drug_prices returns data frame of drug prices elements.

Usage

parse_drug_prices(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 prices node attributes date frame

Details

This functions extracts the prices element of drug node in drug bank 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 dataframe 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_prices()

# save in database and return parsed dataframe
parse_drug_prices(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_prices(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_prices(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_prices(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_prices(save_csv = TRUE, csv_path = TRUE, override = TRUE)
# }

Run the code above in your browser using DataCamp Workspace