mirror of
https://github.com/msberends/AMR.git
synced 2025-07-11 10:21:54 +02:00
add all options to documentation
This commit is contained in:
@ -20,26 +20,25 @@ With \code{\link[=add_custom_antimicrobials]{add_custom_antimicrobials()}} you c
|
||||
|
||||
There are two ways to automate this process:
|
||||
|
||||
\strong{Method 1:} Save the antimicrobials to a local or remote file (can even be the internet). To use this method:
|
||||
\strong{Method 1:} Using the option \code{\link[=AMR-options]{AMR_custom_ab}}, which is the preferred method. To use this method:
|
||||
\enumerate{
|
||||
\item Create a data set in the structure of the \link{antibiotics} data set (containing at the very least columns "ab" and "name") and save it with \code{\link[=saveRDS]{saveRDS()}} to a location of choice, e.g. \code{"~/my_custom_ab.rds"}, or any remote location.
|
||||
\item Set the file location to the \code{AMR_custom_ab} \R option: \code{options(AMR_custom_ab = "~/my_custom_ab.rds")}. This can even be a remote file location, such as an https URL. Since options are not saved between \R sessions, it is best to save this option to the \code{.Rprofile} file so that it will loaded on start-up of \R. To do this, open the \code{.Rprofile} file using e.g. \code{utils::file.edit("~/.Rprofile")}, add this text and save the file:
|
||||
\item Set the file location to the option \code{\link[=AMR-options]{AMR_custom_ab}}: \code{options(AMR_custom_ab = "~/my_custom_ab.rds")}. This can even be a remote file location, such as an https URL. Since options are not saved between \R sessions, it is best to save this option to the \code{.Rprofile} file so that it will be loaded on start-up of \R. To do this, open the \code{.Rprofile} file using e.g. \code{utils::file.edit("~/.Rprofile")}, add this text and save the file:
|
||||
|
||||
\if{html}{\out{<div class="sourceCode r">}}\preformatted{# Add custom antibiotic drug codes:
|
||||
\if{html}{\out{<div class="sourceCode r">}}\preformatted{# Add custom antimicrobial codes:
|
||||
options(AMR_custom_ab = "~/my_custom_ab.rds")
|
||||
}\if{html}{\out{</div>}}
|
||||
|
||||
Upon package load, this file will be loaded and run through the \code{\link[=add_custom_antimicrobials]{add_custom_antimicrobials()}} function.
|
||||
}
|
||||
|
||||
\strong{Method 2:} Save the antimicrobial additions directly to your \code{.Rprofile} file. An important downside is that this requires to load the \code{AMR} package at every start-up. To use this method:
|
||||
\strong{Method 2:} Loading the antimicrobial additions directly from your \code{.Rprofile} file. An important downside is that this requires the \code{AMR} package to be installed or else this method will fail. To use this method:
|
||||
\enumerate{
|
||||
\item Edit the \code{.Rprofile} file using e.g. \code{utils::file.edit("~/.Rprofile")}.
|
||||
\item Add a text like below and save the file:
|
||||
|
||||
\if{html}{\out{<div class="sourceCode r">}}\preformatted{ # Add custom antibiotic drug codes:
|
||||
library(AMR)
|
||||
add_custom_antimicrobials(
|
||||
AMR::add_custom_antimicrobials(
|
||||
data.frame(ab = "TESTAB",
|
||||
name = "Test Antibiotic",
|
||||
group = "Test Group")
|
||||
|
Reference in New Issue
Block a user