medications-option | R Documentation |
pregnancy.medications
optionFunctions to get and set the default medications data frame used in the medications_remaining()
function.
Settings persist for the current R session only, unless added to
.Rprofile. set_medications()
sets the "pregnancy.medications" option and get_medications()
retrieves it.
set_medications(meds)
get_medications()
meds |
Data frame containing medication schedule. Must have the following columns:
If NULL, will try to use the "pregnancy.medications" option. Required if option not set. |
Both functions invisibly return the current medications setting:
get_medications()
returns the current setting (a data frame) or NULL if not set
set_medications()
returns the medications data frame that was set
medications_remaining()
, medications
# Store original setting (without messages)
original_medications <- getOption("pregnancy.medications")
# Set the option
set_medications(pregnancy::medications)
# Get the option
get_medications()
# Restore original setting (without messages)
options(pregnancy.medications = original_medications)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.