NEWS.md
- Reference data used for as.rsi()
can now be set by the user, using the reference_data
parameter. This allows for using own interpretation guidelines. The user-set data must have the same structure as rsi_translation
.
Some functions are now context-aware when used inside dplyr
verbs, such as filter()
, mutate()
and summarise()
. This means that then the data parameter does not need to be set anymore. This is the case for the new functions mo_is_gram_negative()
, mo_is_gram_positive()
, mo_is_intrinsic_resistant()
and for the existing functions first_isolate()
, key_antibiotics()
, mdro()
, brmo()
, mrgn()
, mdr_tb()
, mdr_cmi2012()
, eucast_exceptional_phenotypes()
. This was already the case for antibiotic selection functions (such as using penicillins()
in dplyr::select()
).
Interpretation of antimicrobial resistance - as.rsi()
:
as.rsi()
can now be set by the user, using the reference_data
argument. This allows for using own interpretation guidelines. The user-set data must have the same structure as rsi_translation
.as.rsi()
on a data.frameas.rsi()
on a data.frame in older R versionsas.rsi()
on a data.frame will not print a message anymore if the values are already clean R/SI valuesas.rsi()
on MICs or disk diffusion while there is intrinsic antimicrobial resistance, a warning will be thrown to remind about thisas.rsi()
on a data.frame
that only contains one column for antibiotic interpretationsSome functions are now context-aware when used inside dplyr
verbs, such as filter()
, mutate()
and summarise()
. This means that then the data argument does not need to be set anymore. This is the case for the new functions mo_is_gram_negative()
, mo_is_gram_positive()
, mo_is_intrinsic_resistant()
and for the existing functions first_isolate()
, key_antibiotics()
, mdro()
, brmo()
, mrgn()
, mdr_tb()
, mdr_cmi2012()
, eucast_exceptional_phenotypes()
. This was already the case for antibiotic selection functions (such as using penicillins()
in dplyr::select()
).
# to select first isolates that are Gram-negative
@@ -310,23 +321,18 @@
select(mo, cephalosporins(), aminoglycosides()) %>%
as_tibble()
For all function parameters in the code, it is now defined what the exact type of user input should be (inspired by the typed
package). If the user input for a certain function does not meet the requirements for a specific parameter (such as the class or length), an informative error will be thrown. This makes the package more robust and the use of it more reproducible and reliable. In total, more than 400 arguments were defined.
For all function arguments in the code, it is now defined what the exact type of user input should be (inspired by the typed
package). If the user input for a certain function does not meet the requirements for a specific argument (such as the class or length), an informative error will be thrown. This makes the package more robust and the use of it more reproducible and reliable. In total, more than 420 arguments were defined.
Fix for set_mo_source()
, that previously would not remember the file location of the original file
Deprecated function p_symbol()
that not really fits the scope of this package. It will be removed in a future version. See here for the source code to preserve it.
Better determination of disk zones and MIC values when running as.rsi()
on a data.frame
Updated coagulase-negative staphylococci determination with Becker et al. 2020 (PMID 32056452), meaning that the species S. argensis, S. caeli, S. debuckii, S. edaphicus and S. pseudoxylosus are now all considered CoNS
Fix for using parameter reference_df
in as.mo()
and mo_*()
functions that contain old microbial codes (from previous package versions)
Fix for using as.rsi()
on a data.frame in older R versions
as.rsi()
on a data.frame will not print a message anymore if the values are already clean R/SI values
Fix for using argument reference_df
in as.mo()
and mo_*()
functions that contain old microbial codes (from previous package versions)
Fixed a bug where mo_uncertainties()
would not return the results based on the MO matching score
Fixed a bug where as.mo()
would not return results for known laboratory codes for microorganisms
Fixed a bug where as.ab()
would sometimes fail
If using as.rsi()
on MICs or disk diffusion while there is intrinsic antimicrobial resistance, a warning will be thrown to remind about this
Better tibble printing for MIC values
Fix for plotting MIC values with plot()
Added plot()
generic to class <disk>
LA-MRSA and CA-MRSA are now recognised as an abbreviation for Staphylococcus aureus, meaning that e.g. mo_genus("LA-MRSA")
will return "Staphylococcus"
and mo_is_gram_positive("LA-MRSA")
will return TRUE
.
Fix for using as.rsi()
on a data.frame
that only contains one column for antibiotic interpretations
Support for ‘EUCAST Expert Rules’ / ‘EUCAST Intrinsic Resistance and Unusual Phenotypes’ version 3.2 of May 2020. With this addition to the previously implemented version 3.1 of 2016, the eucast_rules()
function can now correct for more than 180 different antibiotics and the mdro()
function can determine multidrug resistance based on more than 150 different antibiotics. All previously implemented versions of the EUCAST rules are now maintained and kept available in this package. The eucast_rules()
function consequently gained the parameters version_breakpoints
(at the moment defaults to v10.0, 2020) and version_expertrules
(at the moment defaults to v3.2, 2020). The example_isolates
data set now also reflects the change from v3.1 to v3.2. The mdro()
function now accepts guideline == "EUCAST3.1"
and guideline == "EUCAST3.2"
.
Support for ‘EUCAST Expert Rules’ / ‘EUCAST Intrinsic Resistance and Unusual Phenotypes’ version 3.2 of May 2020. With this addition to the previously implemented version 3.1 of 2016, the eucast_rules()
function can now correct for more than 180 different antibiotics and the mdro()
function can determine multidrug resistance based on more than 150 different antibiotics. All previously implemented versions of the EUCAST rules are now maintained and kept available in this package. The eucast_rules()
function consequently gained the arguments version_breakpoints
(at the moment defaults to v10.0, 2020) and version_expertrules
(at the moment defaults to v3.2, 2020). The example_isolates
data set now also reflects the change from v3.1 to v3.2. The mdro()
function now accepts guideline == "EUCAST3.1"
and guideline == "EUCAST3.2"
.
A new vignette and website page with info about all our public and freely available data sets, that can be downloaded as flat files or in formats for use in R, SPSS, SAS, Stata and Excel: https://msberends.github.io/AMR/articles/datasets.html
Data set intrinsic_resistant
. This data set contains all bug-drug combinations where the ‘bug’ is intrinsic resistant to the ‘drug’ according to the latest EUCAST insights. It contains just two columns: microorganism
and antibiotic
.
Cleaning columns in a data.frame now allows you to specify those columns with tidy selection, e.g. as.rsi(df, col1:col9)
Big speed improvement for interpreting MIC values and disk zone diameters. When interpreting 5,000 MIC values of two antibiotics (10,000 values in total), our benchmarks showed a total run time going from 80.7-85.1 seconds to 1.8-2.0 seconds.
Added parameter ‘add_intrinsic_resistance’ (defaults to FALSE
), that considers intrinsic resistance according to EUCAST
Added argument ‘add_intrinsic_resistance’ (defaults to FALSE
), that considers intrinsic resistance according to EUCAST
Fixed a bug where in EUCAST rules the breakpoint for R would be interpreted as “>=” while this should have been “<”
mo_matching_score()
. Any user input value that could mean more than one taxonomic entry is now considered ‘uncertain’. Instead of a warning, a message will be thrown and the accompanying mo_uncertainties()
has been changed completely; it now prints all possible candidates with their matching score.mo_*
functions like mo_name()
on microoganism IDs.ignore_pattern
to as.mo()
which can also be given to mo_*
functions like mo_name()
, to exclude known non-relevant input from analysing. This can also be set with the option AMR_ignore_pattern
.ignore_pattern
to as.mo()
which can also be given to mo_*
functions like mo_name()
, to exclude known non-relevant input from analysing. This can also be set with the option AMR_ignore_pattern
.get_locale()
now uses at default Sys.getenv("LANG")
or, if LANG
is not set, Sys.getlocale()
. This can be overwritten by setting the option AMR_locale
.
Updated the documentation of the WHONET
data set to clarify that all patient names are fictitious
Small as.ab()
algorithm improvements
Fix for combining MIC values with raw numbers, i.e. c(as.mic(2), 2)
previously failed but now returns a valid MIC class
ggplot_rsi()
and geom_rsi()
gained parameters minimum
and language
, to influence the internal use of rsi_df()
ggplot_rsi()
and geom_rsi()
gained arguments minimum
and language
, to influence the internal use of rsi_df()
Changes in the antibiotics
data set:
Added support for using unique()
on classes <rsi>
, <mic>
, <disk>
, <ab>
and <mo>
Added parameter excess
to the kurtosis()
function (defaults to FALSE
), to return the excess kurtosis, defined as the kurtosis minus three.
Added argument excess
to the kurtosis()
function (defaults to FALSE
), to return the excess kurtosis, defined as the kurtosis minus three.
Added official antimicrobial names to all filter_ab_class()
functions, such as filter_aminoglycosides()
Added antibiotics code “FOX1” for cefoxitin screening (abbreviation “cfsc”) to the antibiotics
data set
Added Monuril as trade name for fosfomycin
Added parameter conserve_capped_values
to as.rsi()
for interpreting MIC values - it makes sure that values starting with “<” (but not “<=”) will always return “S” and values starting with “>” (but not “>=”) will always return “R”. The default behaviour of as.rsi()
has not changed, so you need to specifically do as.rsi(..., conserve_capped_values = TRUE)
.
Added argument conserve_capped_values
to as.rsi()
for interpreting MIC values - it makes sure that values starting with “<” (but not “<=”) will always return “S” and values starting with “>” (but not “>=”) will always return “R”. The default behaviour of as.rsi()
has not changed, so you need to specifically do as.rsi(..., conserve_capped_values = TRUE)
.
Making this package independent of especially the tidyverse (e.g. packages dplyr
and tidyr
) tremendously increases sustainability on the long term, since tidyverse functions change quite often. Good for users, but hard for package maintainers. Most of our functions are replaced with versions that only rely on base R, which keeps this package fully functional for many years to come, without requiring a lot of maintenance to keep up with other packages anymore. Another upside it that this package can now be used with all versions of R since R-3.0.0 (April 2013). Our package is being used in settings where the resources are very limited. Fewer dependencies on newer software is helpful for such settings.
Negative effects of this change are:
freq()
that was borrowed from the cleaner
package was removed. Use cleaner::freq()
, or run library("cleaner")
before you use freq()
.freq()
that was borrowed from the cleaner
package was removed. Use cleaner::freq()
, or run library("cleaner")
before you use freq()
.mo
or rsi
in a tibble will no longer be in colour and printing rsi
in a tibble will show the class <ord>
, not <rsi>
anymore. This is purely a visual effect.mo_*
family (like mo_name()
and mo_gramstain()
) are noticeably slower when running on hundreds of thousands of rows.mo
and ab
now both also inherit class character
, to support any data transformation. This change invalidates code that checks for class length == 1.Added antibiotic abbreviations for a laboratory manufacturer (GLIMS) for cefuroxime, cefotaxime, ceftazidime, cefepime, cefoxitin and trimethoprim/sulfamethoxazole
Added uti
(as abbreviation of urinary tract infections) as parameter to as.rsi()
, so interpretation of MIC values and disk zones can be made dependent on isolates specifically from UTIs
Added uti
(as abbreviation of urinary tract infections) as argument to as.rsi()
, so interpretation of MIC values and disk zones can be made dependent on isolates specifically from UTIs
Info printing in functions eucast_rules()
, first_isolate()
, mdro()
and resistance_predict()
will now at default only print when R is in an interactive mode (i.e. not in RMarkdown)
Determination of first isolates now excludes all ‘unknown’ microorganisms at default, i.e. microbial code "UNKNOWN"
. They can be included with the new parameter include_unknown
:
Determination of first isolates now excludes all ‘unknown’ microorganisms at default, i.e. microbial code "UNKNOWN"
. They can be included with the new argument include_unknown
:
first_isolate(..., include_unknown = TRUE)
This is important, because a value like "testvalue"
could never be understood by e.g. mo_name()
, although the class would suggest a valid microbial code.
Function freq()
has moved to a new package, clean
(CRAN link), since creating frequency tables actually does not fit the scope of this package. The freq()
function still works, since it is re-exported from the clean
package (which will be installed automatically upon updating this AMR
package).
Function freq()
has moved to a new package, clean
(CRAN link), since creating frequency tables actually does not fit the scope of this package. The freq()
function still works, since it is re-exported from the clean
package (which will be installed automatically upon updating this AMR
package).
Renamed data set septic_patients
to example_isolates
Additional way to calculate co-resistance, i.e. when using multiple antimicrobials as input for portion_*
functions or count_*
functions. This can be used to determine the empiric susceptibility of a combination therapy. A new parameter only_all_tested
(which defaults to FALSE
) replaces the old also_single_tested
and can be used to select one of the two methods to count isolates and calculate portions. The difference can be seen in this example table (which is also on the portion
and count
help pages), where the %SI is being determined:
Additional way to calculate co-resistance, i.e. when using multiple antimicrobials as input for portion_*
functions or count_*
functions. This can be used to determine the empiric susceptibility of a combination therapy. A new argument only_all_tested
(which defaults to FALSE
) replaces the old also_single_tested
and can be used to select one of the two methods to count isolates and calculate portions. The difference can be seen in this example table (which is also on the portion
and count
help pages), where the %SI is being determined:
# --------------------------------------------------------------------
@@ -987,13 +993,13 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
Fix and speed improvement for mo_shortname()
Fix for using mo_*
functions where the coercion uncertainties and failures would not be available through mo_uncertainties()
and mo_failures()
anymore
-Deprecated the country
parameter of mdro()
in favour of the already existing guideline
parameter to support multiple guidelines within one country
+Deprecated the country
argument of mdro()
in favour of the already existing guideline
argument to support multiple guidelines within one country
The name
of RIF
is now Rifampicin instead of Rifampin
The antibiotics
data set is now sorted by name and all cephalosporins now have their generation between brackets
Speed improvement for guess_ab_col()
which is now 30 times faster for antibiotic abbreviations
Improved filter_ab_class()
to be more reliable and to support 5th generation cephalosporins
Function availability()
now uses portion_R()
instead of portion_IR()
, to comply with EUCAST insights
-Functions age()
and age_groups()
now have a na.rm
parameter to remove empty values
+Functions age()
and age_groups()
now have a na.rm
argument to remove empty values
Renamed function p.symbol()
to p_symbol()
(the former is now deprecated and will be removed in a future version)
Using negative values for x
in age_groups()
will now introduce NA
s and not return an error anymore
Fix for determining the system’s language
@@ -1137,18 +1143,18 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
Improvements to plotting AMR results with ggplot_rsi()
:
-- New parameter
colours
to set the bar colours
-- New parameters
title
, subtitle
, caption
, x.title
and y.title
to set titles and axis descriptions
+- New argument
colours
to set the bar colours
+- New arguments
title
, subtitle
, caption
, x.title
and y.title
to set titles and axis descriptions
Improved intelligence of looking up antibiotic columns in a data set using guess_ab_col()
Added ~5,000 more old taxonomic names to the microorganisms.old
data set, which leads to better results finding when using the as.mo()
function
-This package now honours the new EUCAST insight (2019) that S and I are but classified as susceptible, where I is defined as ‘increased exposure’ and not ‘intermediate’ anymore. For functions like portion_df()
and count_df()
this means that their new parameter combine_SI
is TRUE at default. Our plotting function ggplot_rsi()
also reflects this change since it uses count_df()
internally.
-The age()
function gained a new parameter exact
to determine ages with decimals
+This package now honours the new EUCAST insight (2019) that S and I are but classified as susceptible, where I is defined as ‘increased exposure’ and not ‘intermediate’ anymore. For functions like portion_df()
and count_df()
this means that their new argument combine_SI
is TRUE at default. Our plotting function ggplot_rsi()
also reflects this change since it uses count_df()
internally.
+The age()
function gained a new argument exact
to determine ages with decimals
Removed deprecated functions guess_mo()
, guess_atc()
, EUCAST_rules()
, interpretive_reading()
, rsi()
-Frequency tables (freq()
):
+ Frequency tables (freq()
):
speed improvement for microbial IDs
fixed factor level names for R Markdown
@@ -1158,12 +1164,12 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
@@ -1173,7 +1179,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
Added ceftazidim intrinsic resistance to Streptococci
Changed default settings for age_groups()
, to let groups of fives and tens end with 100+ instead of 120+
-Fix for freq()
for when all values are NA
+ Fix for freq()
for when all values are NA
Fix for first_isolate()
for when dates are missing
Improved speed of guess_ab_col()
@@ -1216,14 +1222,14 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
New website!
We’ve got a new website: https://msberends.gitlab.io/AMR (built with the great pkgdown
)
-- Contains the complete manual of this package and all of its functions with an explanation of their parameters
+- Contains the complete manual of this package and all of its functions with an explanation of their arguments
- Contains a comprehensive tutorial about how to conduct antimicrobial resistance analysis, import data from WHONET or SPSS and many more.
New
-BREAKING: removed deprecated functions, parameters and references to ‘bactid’. Use as.mo()
to identify an MO code.
+BREAKING: removed deprecated functions, arguments and references to ‘bactid’. Use as.mo()
to identify an MO code.
-
Catalogue of Life as a new taxonomic source for data about microorganisms, which also contains all ITIS data we used previously. The microorganisms
data set now contains:
@@ -1243,7 +1249,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
-
Support for data from WHONET and EARS-Net (European Antimicrobial Resistance Surveillance Network):
-- Exported files from WHONET can be read and used in this package. For functions like
first_isolate()
and eucast_rules()
, all parameters will be filled in automatically.
+- Exported files from WHONET can be read and used in this package. For functions like
first_isolate()
and eucast_rules()
, all arguments will be filled in automatically.
- This package now knows all antibiotic abbrevations by EARS-Net (which are also being used by WHONET) - the
antibiotics
data set now contains a column ears_net
.
- The function
as.mo()
now knows all WHONET species abbreviations too, because almost 2,000 microbial abbreviations were added to the microorganisms.codes
data set.
@@ -1390,17 +1396,17 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
- Function
first_isolate()
:
- Fixed a bug where distances between dates would not be calculated right - in the
septic_patients
data set this yielded a difference of 0.15% more isolates
-- Will now use a column named like “patid” for the patient ID (parameter
col_patientid
), when this parameter was left blank
-- Will now use a column named like “key(…)ab” or “key(…)antibiotics” for the key antibiotics (parameter
col_keyantibiotics()
), when this parameter was left blank
-- Removed parameter
output_logical
, the function will now always return a logical value
-- Renamed parameter
filter_specimen
to specimen_group
, although using filter_specimen
will still work
+- Will now use a column named like “patid” for the patient ID (argument
col_patientid
), when this argument was left blank
+- Will now use a column named like “key(…)ab” or “key(…)antibiotics” for the key antibiotics (argument
col_keyantibiotics()
), when this argument was left blank
+- Removed argument
output_logical
, the function will now always return a logical value
+- Renamed argument
filter_specimen
to specimen_group
, although using filter_specimen
will still work
-- A note to the manual pages of the
portion
functions, that low counts can influence the outcome and that the portion
functions may camouflage this, since they only return the portion (albeit being dependent on the minimum
parameter)
+- A note to the manual pages of the
portion
functions, that low counts can influence the outcome and that the portion
functions may camouflage this, since they only return the portion (albeit being dependent on the minimum
argument)
- Merged data sets
microorganisms.certe
and microorganisms.umcg
into microorganisms.codes
- Function
mo_taxonomy()
now contains the kingdom too
-- Reduce false positives for
is.rsi.eligible()
using the new threshold
parameter
+- Reduce false positives for
is.rsi.eligible()
using the new threshold
argument
- New colours for
scale_rsi_colours()
- Summaries of class
mo
will now return the top 3 and the unique count, e.g. using summary(mo)
@@ -1414,7 +1420,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
-- Frequency tables (
freq()
function):
+ - Frequency tables (
freq()
function):
-
Support for tidyverse quasiquotation! Now you can create frequency tables of function outcomes:
@@ -1424,29 +1430,29 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
# OLD WAY
septic_patients %>%
mutate(genus = mo_genus(mo)) %>%
- freq(genus)
+ freq(genus)
# NEW WAY
septic_patients %>%
- freq(mo_genus(mo))
+ freq(mo_genus(mo))
# Even supports grouping variables:
septic_patients %>%
group_by(gender) %>%
- freq(mo_genus(mo))
+ freq(mo_genus(mo))
Header info is now available as a list, with the header
function
The parameter header
is now set to TRUE
at default, even for markdown
The argument header
is now set to TRUE
at default, even for markdown
Added header info for class mo
to show unique count of families, genera and species
Now honours the decimal.mark
setting, which just like format
defaults to getOption("OutDec")
The new big.mark
parameter will at default be ","
when decimal.mark = "."
and "."
otherwise
The new big.mark
argument will at default be ","
when decimal.mark = "."
and "."
otherwise
Fix for header text where all observations are NA
New parameter droplevels
to exclude empty factor levels when input is a factor
New argument droplevels
to exclude empty factor levels when input is a factor
Factor levels will be in header when present in input data (maximum of 5)
Fix for using select()
on frequency tables
scale_y_percent()
now contains the limits
parametermdro()
, key_antibiotics()
and eucast_rules()
+scale_y_percent()
now contains the limits
argumentmdro()
, key_antibiotics()
and eucast_rules()
resistance_predict()
function)as.mic()
to support more values ending in (several) zeroescount_all
to get all available isolates (that like all portion_*
and count_*
functions also supports summarise
and group_by
), the old n_rsi
is now an alias of count_all
get_locale
to determine language for language-dependent output for some mo_*
functions. This is now the default value for their language
parameter, by which the system language will be used at default.get_locale
to determine language for language-dependent output for some mo_*
functions. This is now the default value for their language
argument, by which the system language will be used at default.microorganismsDT
, microorganisms.prevDT
, microorganisms.unprevDT
and microorganisms.oldDT
to improve the speed of as.mo
. They are for reference only, since they are primarily for internal use of as.mo
.read.4D
to read from the 4D database of the MMB department of the UMCGmo_authors
and mo_year
to get specific values about the scientific reference of a taxonomic entryBig changes to the eucast_rules
function:
rules
to specify which rules should be applied (expert rules, breakpoints, others or all)verbose
which can be set to TRUE
to get very specific messages about which columns and rows were affectedrules
to specify which rules should be applied (expert rules, breakpoints, others or all)verbose
which can be set to TRUE
to get very specific messages about which columns and rows were affectedseptic_patients
now reflects these changespipe
for piperacillin (J01CA12), also to the mdro
functionpipe
for piperacillin (J01CA12), also to the mdro
functionAdded parameter combine_IR
(TRUE/FALSE) to functions portion_df
and count_df
, to indicate that all values of I and R must be merged into one, so the output only consists of S vs. IR (susceptible vs. non-susceptible)
Added argument combine_IR
(TRUE/FALSE) to functions portion_df
and count_df
, to indicate that all values of I and R must be merged into one, so the output only consists of S vs. IR (susceptible vs. non-susceptible)
Fix for portion_*(..., as_percent = TRUE)
when minimal number of isolates would not be met
Added parameter also_single_tested
for portion_*
and count_*
functions to also include cases where not all antibiotics were tested but at least one of the tested antibiotics includes the target antimicribial interpretation, see ?portion
Using portion_*
functions now throws a warning when total available isolate is below parameter minimum
Added argument also_single_tested
for portion_*
and count_*
functions to also include cases where not all antibiotics were tested but at least one of the tested antibiotics includes the target antimicribial interpretation, see ?portion
Using portion_*
functions now throws a warning when total available isolate is below argument minimum
Functions as.mo
, as.rsi
, as.mic
, as.atc
and freq
will not set package name as attribute anymore
Frequency tables - freq()
:
Frequency tables - freq()
:
Support for grouping variables, test with:
@@ -1523,33 +1529,33 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
septic_patients %>%
group_by(hospital_id) %>%
- freq(gender)
+ freq(gender)
Support for (un)selecting columns:
Check for hms::is.hms
Now prints in markdown at default in non-interactive sessions
No longer adds the factor level column and sorts factors on count again
Support for class difftime
New parameter na
, to choose which character to print for empty values
New parameter header
to turn the header info off (default when markdown = TRUE
)
New parameter title
to manually setbthe title of the frequency table
New argument na
, to choose which character to print for empty values
New argument header
to turn the header info off (default when markdown = TRUE
)
New argument title
to manually setbthe title of the frequency table
first_isolate
now tries to find columns to use as input when parameters are left blank
first_isolate
now tries to find columns to use as input when arguments are left blank
Improvements for MDRO algorithm (function mdro
)
Data set septic_patients
is now a data.frame
, not a tibble anymore
Removed diacritics from all authors (columns microorganisms$ref
and microorganisms.old$ref
) to comply with CRAN policy to only allow ASCII characters
Fix for mo_property
not working properly
Fix for eucast_rules
where some Streptococci would become ceftazidime R in EUCAST rule 4.5
Support for named vectors of class mo
, useful for top_freq()
ggplot_rsi
and scale_y_percent
have breaks
parameter
Support for named vectors of class mo
, useful for top_freq()
ggplot_rsi
and scale_y_percent
have breaks
argument
AI improvements for as.mo
:
Added parameter reference_df
for as.mo
, so users can supply their own microbial IDs, name or codes as a reference table
Added argument reference_df
for as.mo
, so users can supply their own microbial IDs, name or codes as a reference table
Renamed all previous references to bactid
to mo
, like:
Fix for as.mic
for values ending in zeroes after a real number
Small fix where B. fragilis would not be found in the microorganisms.umcg
data set
Added prevalence
column to the microorganisms
data set
Added parameters minimum
and as_percent
to portion_df
Added arguments minimum
and as_percent
to portion_df
Support for quasiquotation in the functions series count_*
and portions_*
, and n_rsi
. This allows to check for more than 2 vectors or columns.
@@ -1703,12 +1709,12 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/ septic_patients %>% portion_S(amcl, gent) septic_patients %>% portion_S(amcl, gent, pita)
Edited ggplot_rsi
and geom_rsi
so they can cope with count_df
. The new fun
parameter has value portion_df
at default, but can be set to count_df
.
Edited ggplot_rsi
and geom_rsi
so they can cope with count_df
. The new fun
argument has value portion_df
at default, but can be set to count_df
.
Fix for ggplot_rsi
when the ggplot2
package was not loaded
Added datalabels function labels_rsi_count
to ggplot_rsi
Added possibility to set any parameter to geom_rsi
(and ggplot_rsi
) so you can set your own preferences
Added possibility to set any argument to geom_rsi
(and ggplot_rsi
) so you can set your own preferences
Fix for joins, where predefined suffices would not be honoured
Added parameter quote
to the freq
function
Added argument quote
to the freq
function
Added generic function diff
for frequency tables
Added longest en shortest character length in the frequency table (freq
) header of class character
For lists, subsetting is possible:
my_list = list(age = septic_patients$age, gender = septic_patients$gender)
-my_list %>% freq(age)
-my_list %>% freq(gender)
rsi
(antimicrobial resistance) to use as inputtable
to use as input: freq(table(x, y))
+table
to use as input: freq(table(x, y))
hist
and plot
to use a frequency table as input: hist(freq(df$age))
as.vector
, as.data.frame
, as_tibble
and format
freq(mydata, mycolumn)
is the same as mydata %>% freq(mycolumn)
+freq(mydata, mycolumn)
is the same as mydata %>% freq(mycolumn)
top_freq
function to return the top/below n items as vectorresistance_predict
and added more examplesseptic_patients
data set to better reflect the realitymic
and rsi
classes now returns all values - use freq
to check distributionsabname
function%like%
now supports multiple patternsdata.frame
s with altered console printing to make it look like a frequency table. Because of this, the parameter toConsole
is not longer needed.data.frame
s with altered console printing to make it look like a frequency table. Because of this, the argument toConsole
is not longer needed.freq
where the class of an item would be lostseptic_patients
dataset and the column bactid
now has the new class "bactid"
join
functions%like%
to make it case insensitivefirst_isolate
and EUCAST_rules
column names are now case-insensitivefirst_isolate
and EUCAST_rules
column names are now case-insensitiveas.rsi
and as.mic
now add the package name and version as attributesparameters passed on to as.ab()
arguments passed on to as.ab()
A list, or a character if collapse
is not NULL
This function is also internally used by as.ab()
, although it then only searches for the first drug name and will throw a note if more drug names could have been returned.
type
This function is also internally used by as.ab()
, although it then only searches for the first drug name and will throw a note if more drug names could have been returned.
type
At default, the function will search for antimicrobial drug names. All text elements will be searched for official names, ATC codes and brand names. As it uses as.ab()
internally, it will correct for misspelling.
With type = "dose"
(or similar, like "dosing", "doses"), all text elements will be searched for numeric values that are higher than 100 and do not resemble years. The output will be numeric. It supports any unit (g, mg, IE, etc.) and multiple values in one clinical text, see Examples.
With type = "administration"
(or abbreviations, like "admin", "adm"), all text elements will be searched for a form of drug administration. It supports the following forms (including common abbreviations): buccal, implant, inhalation, instillation, intravenous, nasal, oral, parenteral, rectal, sublingual, transdermal and vaginal. Abbreviations for oral (such as 'po', 'per os') will become "oral", all values for intravenous (such as 'iv', 'intraven') will become "iv". It supports multiple values in one clinical text, see Examples.
collapse
collapse
Without using collapse
, this function will return a list. This can be convenient to use e.g. inside a mutate()
):
df %>% mutate(abx = ab_from_text(clinical_text))
The returned AB codes can be transformed to official names, groups, etc. with all ab_*
functions such as ab_name()
and ab_group()
, or by using the translate_ab
parameter.
The returned AB codes can be transformed to official names, groups, etc. with all ab_*
functions such as ab_name()
and ab_group()
, or by using the translate_ab
argument.
With using collapse
, this function will return a character:
df %>% mutate(abx = ab_from_text(clinical_text, collapse = "|"))
other parameters passed on to as.ab()
other arguments passed on to as.ab()
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
parameters passed on to as.POSIXlt()
, such as origin
arguments passed on to as.POSIXlt()
, such as origin
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
Split ages into age groups defined by the split
parameter. This allows for easier demographic (antimicrobial resistance) analysis.
Split ages into age groups defined by the split
argument. This allows for easier demographic (antimicrobial resistance) analysis.
age_groups(x, split_at = c(12, 25, 55, 75), na.rm = FALSE)@@ -297,7 +297,7 @@
Ordered factor
To split ages, the input for the split_at
parameter can be:
To split ages, the input for the split_at
argument can be:
A numeric vector. A value of e.g. c(10, 20)
will split x
on 0-9, 10-19 and 20+. A value of only 50
will split x
on 0-49 and 50+.
The default is to split on young children (0-11), youth (12-24), young adults (25-54), middle-aged adults (55-74) and elderly (75+).
A character:
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
other parameters passed on to functions
other arguments passed on to functions
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
for using on a data.frame: names of columns to apply as.rsi()
on (supports tidy selection like AMX:VAN
). Otherwise: parameters passed on to methods.
for using on a data.frame: names of columns to apply as.rsi()
on (supports tidy selection like AMX:VAN
). Otherwise: arguments passed on to methods.
a data.frame to be used for interpretation, which defaults to the rsi_translation data set. Changing this parameter allows for using own interpretation guidelines. This parameter must contain a data set that is equal in structure to the rsi_translation data set (same column names and column types). Please note that the guideline
parameter will be ignored when reference_data
is manually set.
a data.frame to be used for interpretation, which defaults to the rsi_translation data set. Changing this argument allows for using own interpretation guidelines. This argument must contain a data set that is equal in structure to the rsi_translation data set (same column names and column types). Please note that the guideline
argument will be ignored when reference_data
is manually set.
The as.rsi()
function works in four ways:
For cleaning raw / untransformed data. The data will be cleaned to only contain values S, I and R and will try its best to determine this with some intelligence. For example, mixed values with R/SI interpretations and MIC values such as "<0.25; S"
will be coerced to "S"
. Combined interpretations for multiple test methods (as seen in laboratory records) such as "S; S"
will be coerced to "S"
, but a value like "S; I"
will return NA
with a warning that the input is unclear.
For interpreting minimum inhibitory concentration (MIC) values according to EUCAST or CLSI. You must clean your MIC values first using as.mic()
, that also gives your columns the new data class mic
. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the mo
parameter.
For interpreting minimum inhibitory concentration (MIC) values according to EUCAST or CLSI. You must clean your MIC values first using as.mic()
, that also gives your columns the new data class mic
. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the mo
argument.
Using dplyr
, R/SI interpretation can be done very easily with either:
your_data %>% mutate_if(is.mic, as.rsi) # until dplyr 1.0.0 your_data %>% mutate(across(where(is.mic), as.rsi)) # since dplyr 1.0.0
Operators like "<=" will be stripped before interpretation. When using conserve_capped_values = TRUE
, an MIC value of e.g. ">2" will always return "R", even if the breakpoint according to the chosen guideline is ">=4". This is to prevent that capped values from raw laboratory data would not be treated conservatively. The default behaviour (conserve_capped_values = FALSE
) considers ">2" to be lower than ">=4" and might in this case return "S" or "I".
For interpreting disk diffusion diameters according to EUCAST or CLSI. You must clean your disk zones first using as.disk()
, that also gives your columns the new data class disk
. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the mo
parameter.
For interpreting disk diffusion diameters according to EUCAST or CLSI. You must clean your disk zones first using as.disk()
, that also gives your columns the new data class disk
. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the mo
argument.
Using dplyr
, R/SI interpretation can be done very easily with either:
your_data %>% mutate_if(is.disk, as.rsi) # until dplyr 1.0.0 your_data %>% mutate(across(where(is.disk), as.rsi)) # since dplyr 1.0.0
For interpreting MIC values as well as disk diffusion diameters, supported guidelines to be used as input for the guideline
parameter are: "CLSI 2010", "CLSI 2011", "CLSI 2012", "CLSI 2013", "CLSI 2014", "CLSI 2015", "CLSI 2016", "CLSI 2017", "CLSI 2018", "CLSI 2019", "EUCAST 2011", "EUCAST 2012", "EUCAST 2013", "EUCAST 2014", "EUCAST 2015", "EUCAST 2016", "EUCAST 2017", "EUCAST 2018", "EUCAST 2019", "EUCAST 2020".
Simply using "CLSI"
or "EUCAST"
as input will automatically select the latest version of that guideline. You can set your own data set using the reference_data
parameter. The guideline
parameter will then be ignored.
For interpreting MIC values as well as disk diffusion diameters, supported guidelines to be used as input for the guideline
argument are: "CLSI 2010", "CLSI 2011", "CLSI 2012", "CLSI 2013", "CLSI 2014", "CLSI 2015", "CLSI 2016", "CLSI 2017", "CLSI 2018", "CLSI 2019", "EUCAST 2011", "EUCAST 2012", "EUCAST 2013", "EUCAST 2014", "EUCAST 2015", "EUCAST 2016", "EUCAST 2017", "EUCAST 2018", "EUCAST 2019", "EUCAST 2020".
Simply using "CLSI"
or "EUCAST"
as input will automatically select the latest version of that guideline. You can set your own data set using the reference_data
argument. The guideline
argument will then be ignored.
The function is.rsi.eligible()
returns TRUE
when a columns contains at most 5% invalid antimicrobial interpretations (not S and/or I and/or R), and FALSE
otherwise. The threshold of 5% can be set with the threshold
parameter.
The function is.rsi.eligible()
returns TRUE
when a columns contains at most 5% invalid antimicrobial interpretations (not S and/or I and/or R), and FALSE
otherwise. The threshold of 5% can be set with the threshold
argument.
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
parameters to pass on to atc_property
arguments to pass on to atc_property
https://www.whocc.no/atc_ddd_alterations__cumulative/ddd_alterations/abbrevations/
Options for parameter administration
:
Options for argument administration
:
"Implant"
= Implant
"Inhal"
= Inhalation
"Instill"
= Instillation
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter combine_IR
, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is TRUE
.
a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the argument combine_IR
, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is TRUE
.
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter combine_IR
, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is TRUE
.
a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the argument combine_IR
, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is TRUE
.
a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see parameter combine_SI
.
a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see argument combine_SI
.
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
Important examples include amoxicillin and amoxicillin/clavulanic acid, and trimethoprim and trimethoprim/sulfamethoxazole. Needless to say, for these rules to work, both drugs must be available in the data set.
-Since these rules are not officially approved by EUCAST, they are not applied at default. To use these rules, include "other"
to the rules
parameter, or use eucast_rules(..., rules = "all")
.
Since these rules are not officially approved by EUCAST, they are not applied at default. To use these rules, include "other"
to the rules
argument, or use eucast_rules(..., rules = "all")
.
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
antibiotic_class_selectors()
for the select()
equivalent.
logical whether ICU isolates should be excluded (rows with value TRUE
in column col_icu
)
logical whether ICU isolates should be excluded (rows with value TRUE
in the column set with col_icu
)
value in column col_specimen
to filter on
value in the column set with col_specimen
to filter on
parameters passed on to first_isolate()
when using filter_first_isolate()
, or parameters passed on to key_antibiotics()
when using filter_first_weighted_isolate()
arguments passed on to first_isolate()
when using filter_first_isolate()
, or arguments passed on to key_antibiotics()
when using filter_first_weighted_isolate()
A logical
vector
These functions are context-aware when used inside dplyr
verbs, such as filter()
, mutate()
and summarise()
. This means that then the x
parameter can be omitted, please see Examples.
These functions are context-aware when used inside dplyr
verbs, such as filter()
, mutate()
and summarise()
. This means that then the x
argument can be omitted, please see Examples.
The first_isolate()
function is a wrapper around the is_new_episode()
function, but more efficient for data sets containing microorganism codes or names.
All isolates with a microbial ID of NA
will be excluded as first isolate.
There are two ways to determine whether isolates can be included as first weighted isolates which will give generally the same results:
Using type = "keyantibiotics"
and parameter ignore_I
Using type = "keyantibiotics"
and argument ignore_I
Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With ignore_I = FALSE
, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. Read more about this in the key_antibiotics()
function.
Using type = "points"
and parameter points_threshold
Using type = "points"
and argument points_threshold
A difference from I to S|R (or vice versa) means 0.5 points, a difference from S to R (or vice versa) means 1 point. When the sum of points exceeds points_threshold
, which default to 2
, an isolate will be (re)selected as a first weighted isolate.
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
Parameters passed on to functions
Arguments passed on to functions
As per their GPL-2 licence that demands documentation of code changes, the changes made based on the source code were:
Rewritten code to remove the dependency on packages plyr
, scales
and grid
Parametrised more options, like arrow and ellipse settings
Hardened all input possibilities by defining the exact type of user input for every parameter
Hardened all input possibilities by defining the exact type of user input for every argument
Added total amount of explained variance as a caption in the plot
Cleaned all syntax based on the lintr
package, fixed grammatical errors and added integrity checks
Updated documentation
a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter combine_IR
, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is TRUE
.
a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the argument combine_IR
, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is TRUE
.
a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see parameter combine_SI
.
a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see argument combine_SI
.
other parameters passed on to geom_rsi()
other arguments passed on to geom_rsi()
At default, the names of antibiotics will be shown on the plots using ab_name()
. This can be set with the translate_ab
parameter. See count_df()
.
At default, the names of antibiotics will be shown on the plots using ab_name()
. This can be set with the translate_ab
argument. See count_df()
.
geom_rsi()
will take any variable from the data that has an rsi
class (created with as.rsi()
) using rsi_df()
and will plot bars with the percentage R, I and S. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis.
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
This function determines which items in a vector can be considered (the start of) a new episode, based on the parameter episode_days
. This can be used to determine clinical episodes for any epidemiological analysis.
This function determines which items in a vector can be considered (the start of) a new episode, based on the argument episode_days
. This can be used to determine clinical episodes for any epidemiological analysis.
is_new_episode(x, episode_days = 365, ...)@@ -306,7 +306,7 @@
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
other parameters passed on to functions
other arguments passed on to functions
The key_antibiotics()
function is context-aware when used inside dplyr
verbs, such as filter()
, mutate()
and summarise()
. This means that then the x
parameter can be omitted, please see Examples.
The key_antibiotics()
function is context-aware when used inside dplyr
verbs, such as filter()
, mutate()
and summarise()
. This means that then the x
argument can be omitted, please see Examples.
The function key_antibiotics()
returns a character vector with 12 antibiotic results for every isolate. These isolates can then be compared using key_antibiotics_equal()
, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot ("."
) by key_antibiotics()
and ignored by key_antibiotics_equal()
.
The first_isolate()
function only uses this function on the same microbial species from the same patient. Using this, e.g. an MRSA will be included after a susceptible S. aureus (MSSA) is found within the same patient episode. Without key antibiotic comparison it would not. See first_isolate()
for more info.
At default, the antibiotics that are used for Gram-positive bacteria are:
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
There are two ways to determine whether isolates can be included as first weighted isolates which will give generally the same results:
Using type = "keyantibiotics"
and parameter ignore_I
Using type = "keyantibiotics"
and argument ignore_I
Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With ignore_I = FALSE
, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. Read more about this in the key_antibiotics()
function.
Using type = "points"
and parameter points_threshold
Using type = "points"
and argument points_threshold
A difference from I to S|R (or vice versa) means 0.5 points, a difference from S to R (or vice versa) means 1 point. When the sum of points exceeds points_threshold
, which default to 2
, an isolate will be (re)selected as a first weighted isolate.
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
These functions are context-aware when used inside dplyr
verbs, such as filter()
, mutate()
and summarise()
. This means that then the x
parameter can be omitted, please see Examples.
These functions are context-aware when used inside dplyr
verbs, such as filter()
, mutate()
and summarise()
. This means that then the x
argument can be omitted, please see Examples.
For the pct_required_classes
argument, values above 1 will be divided by 100. This is to support both fractions (0.75
or 3/4
) and percentages (75
).
Currently supported guidelines are (case-insensitive):
guideline = "CMI2012"
(default)
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
Matthijs S. Berends
diff --git a/docs/reference/mo_property.html b/docs/reference/mo_property.html index c200464e..37658f80 100644 --- a/docs/reference/mo_property.html +++ b/docs/reference/mo_property.html @@ -112,7 +112,7 @@ @@ -340,7 +340,7 @@other parameters passed on to as.mo()
, such as 'allow_uncertain' and 'ignore_pattern'
other arguments passed on to as.mo()
, such as 'allow_uncertain' and 'ignore_pattern'
The short name - mo_shortname()
- almost always returns the first character of the genus and the full species, like "E. coli"
. Exceptions are abbreviations of staphylococci (such as "CoNS", Coagulase-Negative Staphylococci) and beta-haemolytic streptococci (such as "GBS", Group B Streptococci). Please bear in mind that e.g. E. coli could mean Escherichia coli (kingdom of Bacteria) as well as Entamoeba coli (kingdom of Protozoa). Returning to the full name will be done using as.mo()
internally, giving priority to bacteria and human pathogens, i.e. "E. coli"
will be considered Escherichia coli. In other words, mo_fullname(mo_shortname("Entamoeba coli"))
returns "Escherichia coli"
.
Since the top-level of the taxonomy is sometimes referred to as 'kingdom' and sometimes as 'domain', the functions mo_kingdom()
and mo_domain()
return the exact same results.
The Gram stain - mo_gramstain()
- will be determined based on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002, PMID 11837318), who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. These bacteria are considered Gram-positive - all other bacteria are considered Gram-negative. Species outside the kingdom of Bacteria will return a value NA
. Functions mo_is_gram_negative()
and mo_is_gram_positive()
always return TRUE
or FALSE
(except when the input is NA
or the MO code is UNKNOWN
), thus always return FALSE
for species outside the taxonomic kingdom of Bacteria.
Intrinsic resistance - mo_is_intrinsic_resistant()
- will be determined based on the intrinsic_resistant data set, which is based on 'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.2 from 2020. The mo_is_intrinsic_resistant()
can be vectorised over parameters x
(input for microorganisms) and over ab
(input for antibiotics).
Intrinsic resistance - mo_is_intrinsic_resistant()
- will be determined based on the intrinsic_resistant data set, which is based on 'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.2 from 2020. The mo_is_intrinsic_resistant()
can be vectorised over arguments x
(input for microorganisms) and over ab
(input for antibiotics).
All output will be translated where possible.
The function mo_url()
will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species.
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
The reference file can be a text file separated with commas (CSV) or tabs or pipes, an Excel file (either 'xls' or 'xlsx' format) or an R object file (extension '.rds'). To use an Excel file, you will need to have the readxl
package installed.
set_mo_source()
will check the file for validity: it must be a data.frame, must have a column named "mo"
which contains values from microorganisms$mo
and must have a reference column with your own defined values. If all tests pass, set_mo_source()
will read the file into R and will ask to export it to "~/mo_source.rds"
. The CRAN policy disallows packages to write to the file system, although 'exceptions may be allowed in interactive sessions if the package obtains confirmation from the user'. For this reason, this function only works in interactive sessions so that the user can specifically confirm and allow that this file will be created. The destination of this file can be set with the destination
parameter and defaults to the user's home directory. It can also be set as an R option, using options(AMR_mo_source = "my/location/file.rds")
.
set_mo_source()
will check the file for validity: it must be a data.frame, must have a column named "mo"
which contains values from microorganisms$mo
and must have a reference column with your own defined values. If all tests pass, set_mo_source()
will read the file into R and will ask to export it to "~/mo_source.rds"
. The CRAN policy disallows packages to write to the file system, although 'exceptions may be allowed in interactive sessions if the package obtains confirmation from the user'. For this reason, this function only works in interactive sessions so that the user can specifically confirm and allow that this file will be created. The destination of this file can be set with the destination
argument and defaults to the user's home directory. It can also be set as an R option, using options(AMR_mo_source = "my/location/file.rds")
.
The created compressed data file "mo_source.rds"
will be used at default for MO determination (function as.mo()
and consequently all mo_*
functions like mo_genus()
and mo_gramstain()
). The location and timestamp of the original file will be saved as an attribute to the compressed data file.
The function get_mo_source()
will return the data set by reading "mo_source.rds"
with readRDS()
. If the original file has changed (by checking the location and timestamp of the original file), it will call set_mo_source()
to update the data file automatically if used in an interactive session.
Reading an Excel file (.xlsx
) with only one row has a size of 8-9 kB. The compressed file created with set_mo_source()
will then have a size of 0.1 kB and can be read by get_mo_source()
in only a couple of microseconds (millionths of a second).
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
Parameters passed on to functions
Arguments passed on to functions
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter combine_IR
, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is TRUE
.
a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the argument combine_IR
, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is TRUE
.
a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see parameter combine_SI
.
a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see argument combine_SI
.
The function resistance()
is equal to the function proportion_R()
. The function susceptibility()
is equal to the function proportion_SI()
.
Remember that you should filter your table to let it contain only first isolates! This is needed to exclude duplicates and to reduce selection bias. Use first_isolate()
to determine them in your data set.
These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the count()
functions to count isolates. The function susceptibility()
is essentially equal to count_susceptible() / count_all()
. Low counts can influence the outcome - the proportion
functions may camouflage this, since they only return the proportion (albeit being dependent on the minimum
parameter).
These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the count()
functions to count isolates. The function susceptibility()
is essentially equal to count_susceptible() / count_all()
. Low counts can influence the outcome - the proportion
functions may camouflage this, since they only return the proportion (albeit being dependent on the minimum
argument).
The function proportion_df()
takes any variable from data
that has an rsi
class (created with as.rsi()
) and calculates the proportions R, I and S. It also supports grouped variables. The function rsi_df()
works exactly like proportion_df()
, but adds the number of isolates.
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
The base R function sample()
is used for generating values.
Generated values are based on the latest EUCAST guideline implemented in the rsi_translation data set. To create specific generated values per bug or drug, set the mo
and/or ab
parameter.
Generated values are based on the latest EUCAST guideline implemented in the rsi_translation data set. To create specific generated values per bug or drug, set the mo
and/or ab
argument.
parameters passed on to functions
arguments passed on to functions
Furthermore, the model itself is available as an attribute: attributes(x)$model
, please see Examples.
Valid options for the statistical model (parameter model
) are:
Valid options for the statistical model (argument model
) are:
"binomial"
or "binom"
or "logit"
: a generalised linear regression model with binomial distribution
"loglin"
or "poisson"
: a generalised log-linear regression model with poisson distribution
"lin"
or "linear"
: a linear regression model
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
+If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
# The 'language' parameter of below functions +# The 'language' argument of below functions # will be set automatically to your system language # with get_locale() diff --git a/docs/survey.html b/docs/survey.html index d706bcdb..e0188b8b 100644 --- a/docs/survey.html +++ b/docs/survey.html @@ -111,7 +111,7 @@ diff --git a/man/ab_from_text.Rd b/man/ab_from_text.Rd index e1d76bdf..16dbdfc6 100644 --- a/man/ab_from_text.Rd +++ b/man/ab_from_text.Rd @@ -24,7 +24,7 @@ ab_from_text( \item{thorough_search}{logical to indicate whether the input must be extensively searched for misspelling and other faulty input values. Setting this to \code{TRUE} will take considerably more time than when using \code{FALSE}. At default, it will turn \code{TRUE} when all input elements contain a maximum of three words.} -\item{...}{parameters passed on to \code{\link[=as.ab]{as.ab()}}} +\item{...}{arguments passed on to \code{\link[=as.ab]{as.ab()}}} } \value{ A \link{list}, or a \link{character} if \code{collapse} is not \code{NULL} @@ -34,7 +34,7 @@ Use this function on e.g. clinical texts from health care records. It returns a } \details{ This function is also internally used by \code{\link[=as.ab]{as.ab()}}, although it then only searches for the first drug name and will throw a note if more drug names could have been returned. -\subsection{Parameter \code{type}}{ +\subsection{Argument \code{type}}{ At default, the function will search for antimicrobial drug names. All text elements will be searched for official names, ATC codes and brand names. As it uses \code{\link[=as.ab]{as.ab()}} internally, it will correct for misspelling. @@ -43,12 +43,12 @@ With \code{type = "dose"} (or similar, like "dosing", "doses"), all text element With \code{type = "administration"} (or abbreviations, like "admin", "adm"), all text elements will be searched for a form of drug administration. It supports the following forms (including common abbreviations): buccal, implant, inhalation, instillation, intravenous, nasal, oral, parenteral, rectal, sublingual, transdermal and vaginal. Abbreviations for oral (such as 'po', 'per os') will become "oral", all values for intravenous (such as 'iv', 'intraven') will become "iv". It supports multiple values in one clinical text, see \emph{Examples}. } -\subsection{Parameter \code{collapse}}{ +\subsection{Argument \code{collapse}}{ Without using \code{collapse}, this function will return a \link{list}. This can be convenient to use e.g. inside a \code{mutate()}):\cr \code{df \%>\% mutate(abx = ab_from_text(clinical_text))} -The returned AB codes can be transformed to official names, groups, etc. with all \code{\link[=ab_property]{ab_*}} functions such as \code{\link[=ab_name]{ab_name()}} and \code{\link[=ab_group]{ab_group()}}, or by using the \code{translate_ab} parameter. +The returned AB codes can be transformed to official names, groups, etc. with all \code{\link[=ab_property]{ab_*}} functions such as \code{\link[=ab_name]{ab_name()}} and \code{\link[=ab_group]{ab_group()}}, or by using the \code{translate_ab} argument. With using \code{collapse}, this function will return a \link{character}:\cr \code{df \%>\% mutate(abx = ab_from_text(clinical_text, collapse = "|"))} diff --git a/man/ab_property.Rd b/man/ab_property.Rd index fdbd80b5..88373c8c 100644 --- a/man/ab_property.Rd +++ b/man/ab_property.Rd @@ -50,7 +50,7 @@ ab_property(x, property = "name", language = get_locale(), ...) \item{tolower}{logical to indicate whether the first character of every output should be transformed to a lower case character. This will lead to e.g. "polymyxin B" and not "polymyxin b".} -\item{...}{other parameters passed on to \code{\link[=as.ab]{as.ab()}}} +\item{...}{other arguments passed on to \code{\link[=as.ab]{as.ab()}}} \item{administration}{way of administration, either \code{"oral"} or \code{"iv"}} @@ -81,7 +81,7 @@ The function \code{\link[=ab_url]{ab_url()}} will return the direct URL to the o \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Source}{ diff --git a/man/age.Rd b/man/age.Rd index 7e99f68d..4a642bb4 100644 --- a/man/age.Rd +++ b/man/age.Rd @@ -15,7 +15,7 @@ age(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE, ...) \item{na.rm}{a logical to indicate whether missing values should be removed} -\item{...}{parameters passed on to \code{\link[=as.POSIXlt]{as.POSIXlt()}}, such as \code{origin}} +\item{...}{arguments passed on to \code{\link[=as.POSIXlt]{as.POSIXlt()}}, such as \code{origin}} } \value{ An \link{integer} (no decimals) if \code{exact = FALSE}, a \link{double} (with decimals) otherwise @@ -31,7 +31,7 @@ Ages below 0 will be returned as \code{NA} with a warning. Ages above 120 will o \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ diff --git a/man/age_groups.Rd b/man/age_groups.Rd index a213c444..2af8d7a6 100644 --- a/man/age_groups.Rd +++ b/man/age_groups.Rd @@ -17,10 +17,10 @@ age_groups(x, split_at = c(12, 25, 55, 75), na.rm = FALSE) Ordered \link{factor} } \description{ -Split ages into age groups defined by the \code{split} parameter. This allows for easier demographic (antimicrobial resistance) analysis. +Split ages into age groups defined by the \code{split} argument. This allows for easier demographic (antimicrobial resistance) analysis. } \details{ -To split ages, the input for the \code{split_at} parameter can be: +To split ages, the input for the \code{split_at} argument can be: \itemize{ \item A numeric vector. A value of e.g. \code{c(10, 20)} will split \code{x} on 0-9, 10-19 and 20+. A value of only \code{50} will split \code{x} on 0-49 and 50+. The default is to split on young children (0-11), youth (12-24), young adults (25-54), middle-aged adults (55-74) and elderly (75+). @@ -38,7 +38,7 @@ The default is to split on young children (0-11), youth (12-24), young adults (2 \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ diff --git a/man/as.ab.Rd b/man/as.ab.Rd index cd5f7fed..cde77591 100644 --- a/man/as.ab.Rd +++ b/man/as.ab.Rd @@ -54,7 +54,7 @@ European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{htt \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{WHOCC}{ diff --git a/man/as.disk.Rd b/man/as.disk.Rd index 99e0b67b..4f782f5e 100644 --- a/man/as.disk.Rd +++ b/man/as.disk.Rd @@ -29,7 +29,7 @@ Interpret disk values as RSI values with \code{\link[=as.rsi]{as.rsi()}}. It sup \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ diff --git a/man/as.mic.Rd b/man/as.mic.Rd index dc35d6ee..615169c1 100755 --- a/man/as.mic.Rd +++ b/man/as.mic.Rd @@ -29,7 +29,7 @@ To interpret MIC values as RSI values, use \code{\link[=as.rsi]{as.rsi()}} on MI \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ diff --git a/man/as.mo.Rd b/man/as.mo.Rd index 3bea43fe..7ad21b42 100644 --- a/man/as.mo.Rd +++ b/man/as.mo.Rd @@ -47,7 +47,7 @@ This excludes \emph{Enterococci} at default (who are in group D), use \code{Lanc \item{language}{language to translate text like "no growth", which defaults to the system language (see \code{\link[=get_locale]{get_locale()}})} -\item{...}{other parameters passed on to functions} +\item{...}{other arguments passed on to functions} } \value{ A \link{character} \link{vector} with additional class \code{\link{mo}} @@ -136,7 +136,7 @@ The intelligent rules consider the prevalence of microorganisms in humans groupe \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Matching score for microorganisms}{ diff --git a/man/as.rsi.Rd b/man/as.rsi.Rd index f66ac98b..99e02870 100755 --- a/man/as.rsi.Rd +++ b/man/as.rsi.Rd @@ -53,7 +53,7 @@ is.rsi.eligible(x, threshold = 0.05) \arguments{ \item{x}{vector of values (for class \code{\link{mic}}: an MIC value in mg/L, for class \code{\link{disk}}: a disk diffusion radius in millimetres)} -\item{...}{for using on a \link{data.frame}: names of columns to apply \code{\link[=as.rsi]{as.rsi()}} on (supports tidy selection like \code{AMX:VAN}). Otherwise: parameters passed on to methods.} +\item{...}{for using on a \link{data.frame}: names of columns to apply \code{\link[=as.rsi]{as.rsi()}} on (supports tidy selection like \code{AMX:VAN}). Otherwise: arguments passed on to methods.} \item{threshold}{maximum fraction of invalid antimicrobial interpretations of \code{x}, please see \emph{Examples}} @@ -69,7 +69,7 @@ is.rsi.eligible(x, threshold = 0.05) \item{add_intrinsic_resistance}{\emph{(only useful when using a EUCAST guideline)} a logical to indicate whether intrinsic antibiotic resistance must also be considered for applicable bug-drug combinations, meaning that e.g. ampicillin will always return "R" in \emph{Klebsiella} species. Determination is based on the \link{intrinsic_resistant} data set, that itself is based on \href{https://www.eucast.org/expert_rules_and_intrinsic_resistance/}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.2} from 2020.} -\item{reference_data}{a \link{data.frame} to be used for interpretation, which defaults to the \link{rsi_translation} data set. Changing this parameter allows for using own interpretation guidelines. This parameter must contain a data set that is equal in structure to the \link{rsi_translation} data set (same column names and column types). Please note that the \code{guideline} parameter will be ignored when \code{reference_data} is manually set.} +\item{reference_data}{a \link{data.frame} to be used for interpretation, which defaults to the \link{rsi_translation} data set. Changing this argument allows for using own interpretation guidelines. This argument must contain a data set that is equal in structure to the \link{rsi_translation} data set (same column names and column types). Please note that the \code{guideline} argument will be ignored when \code{reference_data} is manually set.} \item{col_mo}{column name of the IDs of the microorganisms (see \code{\link[=as.mo]{as.mo()}}), defaults to the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.} } @@ -85,14 +85,14 @@ Interpret minimum inhibitory concentration (MIC) values and disk diffusion diame The \code{\link[=as.rsi]{as.rsi()}} function works in four ways: \enumerate{ \item For \strong{cleaning raw / untransformed data}. The data will be cleaned to only contain values S, I and R and will try its best to determine this with some intelligence. For example, mixed values with R/SI interpretations and MIC values such as \code{"<0.25; S"} will be coerced to \code{"S"}. Combined interpretations for multiple test methods (as seen in laboratory records) such as \code{"S; S"} will be coerced to \code{"S"}, but a value like \code{"S; I"} will return \code{NA} with a warning that the input is unclear. -\item For \strong{interpreting minimum inhibitory concentration (MIC) values} according to EUCAST or CLSI. You must clean your MIC values first using \code{\link[=as.mic]{as.mic()}}, that also gives your columns the new data class \code{\link{mic}}. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the \code{mo} parameter. +\item For \strong{interpreting minimum inhibitory concentration (MIC) values} according to EUCAST or CLSI. You must clean your MIC values first using \code{\link[=as.mic]{as.mic()}}, that also gives your columns the new data class \code{\link{mic}}. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the \code{mo} argument. \itemize{ \item Using \code{dplyr}, R/SI interpretation can be done very easily with either:\preformatted{your_data \%>\% mutate_if(is.mic, as.rsi) # until dplyr 1.0.0 your_data \%>\% mutate(across(where(is.mic), as.rsi)) # since dplyr 1.0.0 } \item Operators like "<=" will be stripped before interpretation. When using \code{conserve_capped_values = TRUE}, an MIC value of e.g. ">2" will always return "R", even if the breakpoint according to the chosen guideline is ">=4". This is to prevent that capped values from raw laboratory data would not be treated conservatively. The default behaviour (\code{conserve_capped_values = FALSE}) considers ">2" to be lower than ">=4" and might in this case return "S" or "I". } -\item For \strong{interpreting disk diffusion diameters} according to EUCAST or CLSI. You must clean your disk zones first using \code{\link[=as.disk]{as.disk()}}, that also gives your columns the new data class \code{\link{disk}}. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the \code{mo} parameter. +\item For \strong{interpreting disk diffusion diameters} according to EUCAST or CLSI. You must clean your disk zones first using \code{\link[=as.disk]{as.disk()}}, that also gives your columns the new data class \code{\link{disk}}. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the \code{mo} argument. \itemize{ \item Using \code{dplyr}, R/SI interpretation can be done very easily with either:\preformatted{your_data \%>\% mutate_if(is.disk, as.rsi) # until dplyr 1.0.0 your_data \%>\% mutate(across(where(is.disk), as.rsi)) # since dplyr 1.0.0 @@ -104,9 +104,9 @@ your_data \%>\% mutate(across(where(is.disk), as.rsi)) # since dplyr 1.0.0 \subsection{Supported guidelines}{ -For interpreting MIC values as well as disk diffusion diameters, supported guidelines to be used as input for the \code{guideline} parameter are: "CLSI 2010", "CLSI 2011", "CLSI 2012", "CLSI 2013", "CLSI 2014", "CLSI 2015", "CLSI 2016", "CLSI 2017", "CLSI 2018", "CLSI 2019", "EUCAST 2011", "EUCAST 2012", "EUCAST 2013", "EUCAST 2014", "EUCAST 2015", "EUCAST 2016", "EUCAST 2017", "EUCAST 2018", "EUCAST 2019", "EUCAST 2020". +For interpreting MIC values as well as disk diffusion diameters, supported guidelines to be used as input for the \code{guideline} argument are: "CLSI 2010", "CLSI 2011", "CLSI 2012", "CLSI 2013", "CLSI 2014", "CLSI 2015", "CLSI 2016", "CLSI 2017", "CLSI 2018", "CLSI 2019", "EUCAST 2011", "EUCAST 2012", "EUCAST 2013", "EUCAST 2014", "EUCAST 2015", "EUCAST 2016", "EUCAST 2017", "EUCAST 2018", "EUCAST 2019", "EUCAST 2020". -Simply using \code{"CLSI"} or \code{"EUCAST"} as input will automatically select the latest version of that guideline. You can set your own data set using the \code{reference_data} parameter. The \code{guideline} parameter will then be ignored. +Simply using \code{"CLSI"} or \code{"EUCAST"} as input will automatically select the latest version of that guideline. You can set your own data set using the \code{reference_data} argument. The \code{guideline} argument will then be ignored. } \subsection{After interpretation}{ @@ -121,7 +121,7 @@ The repository of this package \href{https://github.com/msberends/AMR/blob/maste \subsection{Other}{ -The function \code{\link[=is.rsi.eligible]{is.rsi.eligible()}} returns \code{TRUE} when a columns contains at most 5\% invalid antimicrobial interpretations (not S and/or I and/or R), and \code{FALSE} otherwise. The threshold of 5\% can be set with the \code{threshold} parameter. +The function \code{\link[=is.rsi.eligible]{is.rsi.eligible()}} returns \code{TRUE} when a columns contains at most 5\% invalid antimicrobial interpretations (not S and/or I and/or R), and \code{FALSE} otherwise. The threshold of 5\% can be set with the \code{threshold} argument. } } \section{Interpretation of R and S/I}{ @@ -144,7 +144,7 @@ This AMR package honours this new insight. Use \code{\link[=susceptibility]{susc \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Reference data publicly available}{ @@ -173,7 +173,8 @@ df <- data.frame(microorganism = "Escherichia coli", CIP = as.mic(0.256), GEN = as.disk(18), TOB = as.disk(16), - NIT = as.mic(32)) + NIT = as.mic(32), + ERY = "R") as.rsi(df) # for single values diff --git a/man/atc_online.Rd b/man/atc_online.Rd index 60f508ad..e3b612a1 100644 --- a/man/atc_online.Rd +++ b/man/atc_online.Rd @@ -32,13 +32,13 @@ atc_online_ddd(atc_code, ...) \item{url_vet}{url of website of the WHOCC for veterinary medicine. The sign \verb{\%s} can be used as a placeholder for ATC_vet codes (that all start with "Q").} -\item{...}{parameters to pass on to \code{atc_property}} +\item{...}{arguments to pass on to \code{atc_property}} } \description{ Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic), such as the name, defined daily dose (DDD) or standard unit. } \details{ -Options for parameter \code{administration}: +Options for argument \code{administration}: \itemize{ \item \code{"Implant"} = Implant \item \code{"Inhal"} = Inhalation @@ -71,7 +71,7 @@ Abbreviations of return values when using \code{property = "U"} (unit): \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ diff --git a/man/availability.Rd b/man/availability.Rd index 96d7b42e..59aff104 100644 --- a/man/availability.Rd +++ b/man/availability.Rd @@ -25,7 +25,7 @@ The function returns a \link{data.frame} with columns \code{"resistant"} and \co \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ diff --git a/man/bug_drug_combinations.Rd b/man/bug_drug_combinations.Rd index 6c8a3f09..0849b7b0 100644 --- a/man/bug_drug_combinations.Rd +++ b/man/bug_drug_combinations.Rd @@ -39,7 +39,7 @@ bug_drug_combinations(x, col_mo = NULL, FUN = mo_shortname, ...) \item{minimum}{the minimum allowed number of available (tested) isolates. Any isolate count lower than \code{minimum} will return \code{NA} with a warning. The default number of \code{30} isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.} -\item{combine_SI}{a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is \code{TRUE}.} +\item{combine_SI}{a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the argument \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is \code{TRUE}.} \item{combine_IR}{logical to indicate whether values R and I should be summed} @@ -68,7 +68,7 @@ The function \code{\link[=format]{format()}} calculates the resistance per bug-d \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ diff --git a/man/count.Rd b/man/count.Rd index df26b5a9..9c586a6f 100644 --- a/man/count.Rd +++ b/man/count.Rd @@ -51,9 +51,9 @@ count_df( \item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} -\item{combine_SI}{a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is \code{TRUE}.} +\item{combine_SI}{a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the argument \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is \code{TRUE}.} -\item{combine_IR}{a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see parameter \code{combine_SI}.} +\item{combine_IR}{a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see argument \code{combine_SI}.} } \value{ An \link{integer} @@ -77,7 +77,7 @@ The function \code{\link[=count_df]{count_df()}} takes any variable from \code{d \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Interpretation of R and S/I}{ diff --git a/man/eucast_rules.Rd b/man/eucast_rules.Rd index 321bba7a..543992fb 100644 --- a/man/eucast_rules.Rd +++ b/man/eucast_rules.Rd @@ -66,7 +66,7 @@ Before further processing, two non-EUCAST rules about drug combinations can be a Important examples include amoxicillin and amoxicillin/clavulanic acid, and trimethoprim and trimethoprim/sulfamethoxazole. Needless to say, for these rules to work, both drugs must be available in the data set. -Since these rules are not officially approved by EUCAST, they are not applied at default. To use these rules, include \code{"other"} to the \code{rules} parameter, or use \code{eucast_rules(..., rules = "all")}. +Since these rules are not officially approved by EUCAST, they are not applied at default. To use these rules, include \code{"other"} to the \code{rules} argument, or use \code{eucast_rules(..., rules = "all")}. } } \section{Antibiotics}{ @@ -83,7 +83,7 @@ Amikacin (\code{AMK}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB06&sho \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Reference data publicly available}{ diff --git a/man/filter_ab_class.Rd b/man/filter_ab_class.Rd index f80035e5..550261af 100644 --- a/man/filter_ab_class.Rd +++ b/man/filter_ab_class.Rd @@ -67,7 +67,7 @@ All columns of \code{x} will be searched for known antibiotic names, abbreviatio \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \examples{ diff --git a/man/first_isolate.Rd b/man/first_isolate.Rd index ba34f5e6..80de1d67 100755 --- a/man/first_isolate.Rd +++ b/man/first_isolate.Rd @@ -70,9 +70,9 @@ filter_first_weighted_isolate( \item{testcodes_exclude}{character vector with test codes that should be excluded (case-insensitive)} -\item{icu_exclude}{logical whether ICU isolates should be excluded (rows with value \code{TRUE} in column \code{col_icu})} +\item{icu_exclude}{logical whether ICU isolates should be excluded (rows with value \code{TRUE} in the column set with \code{col_icu})} -\item{specimen_group}{value in column \code{col_specimen} to filter on} +\item{specimen_group}{value in the column set with \code{col_specimen} to filter on} \item{type}{type to determine weighed isolates; can be \code{"keyantibiotics"} or \code{"points"}, see Details} @@ -84,7 +84,7 @@ filter_first_weighted_isolate( \item{include_unknown}{logical to determine whether 'unknown' microorganisms should be included too, i.e. microbial code \code{"UNKNOWN"}, which defaults to \code{FALSE}. For WHONET users, this means that all records with organism code \code{"con"} (\emph{contamination}) will be excluded at default. Isolates with a microbial ID of \code{NA} will always be excluded as first isolate.} -\item{...}{parameters passed on to \code{\link[=first_isolate]{first_isolate()}} when using \code{\link[=filter_first_isolate]{filter_first_isolate()}}, or parameters passed on to \code{\link[=key_antibiotics]{key_antibiotics()}} when using \code{\link[=filter_first_weighted_isolate]{filter_first_weighted_isolate()}}} +\item{...}{arguments passed on to \code{\link[=first_isolate]{first_isolate()}} when using \code{\link[=filter_first_isolate]{filter_first_isolate()}}, or arguments passed on to \code{\link[=key_antibiotics]{key_antibiotics()}} when using \code{\link[=filter_first_weighted_isolate]{filter_first_weighted_isolate()}}} } \value{ A \code{\link{logical}} vector @@ -93,7 +93,7 @@ A \code{\link{logical}} vector Determine first (weighted) isolates of all microorganisms of every patient per episode and (if needed) per specimen type. To determine patient episodes not necessarily based on microorganisms, use \code{\link[=is_new_episode]{is_new_episode()}} that also supports grouping with the \code{dplyr} package. } \details{ -These functions are context-aware when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}. This means that then the \code{x} parameter can be omitted, please see \emph{Examples}. +These functions are context-aware when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}. This means that then the \code{x} argument can be omitted, please see \emph{Examples}. The \code{\link[=first_isolate]{first_isolate()}} function is a wrapper around the \code{\link[=is_new_episode]{is_new_episode()}} function, but more efficient for data sets containing microorganism codes or names. @@ -125,10 +125,10 @@ The function \code{\link[=filter_first_weighted_isolate]{filter_first_weighted_i There are two ways to determine whether isolates can be included as first \emph{weighted} isolates which will give generally the same results: \enumerate{ -\item Using \code{type = "keyantibiotics"} and parameter \code{ignore_I} +\item Using \code{type = "keyantibiotics"} and argument \code{ignore_I} Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With \code{ignore_I = FALSE}, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. Read more about this in the \code{\link[=key_antibiotics]{key_antibiotics()}} function. -\item Using \code{type = "points"} and parameter \code{points_threshold} +\item Using \code{type = "points"} and argument \code{points_threshold} A difference from I to S|R (or vice versa) means 0.5 points, a difference from S to R (or vice versa) means 1 point. When the sum of points exceeds \code{points_threshold}, which default to \code{2}, an isolate will be (re)selected as a first weighted isolate. } @@ -139,7 +139,7 @@ A difference from I to S|R (or vice versa) means 0.5 points, a difference from S \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ diff --git a/man/ggplot_pca.Rd b/man/ggplot_pca.Rd index e8ea5ac7..b3dc4773 100644 --- a/man/ggplot_pca.Rd +++ b/man/ggplot_pca.Rd @@ -10,7 +10,7 @@ As per their GPL-2 licence that demands documentation of code changes, the chang \enumerate{ \item Rewritten code to remove the dependency on packages \code{plyr}, \code{scales} and \code{grid} \item Parametrised more options, like arrow and ellipse settings -\item Hardened all input possibilities by defining the exact type of user input for every parameter +\item Hardened all input possibilities by defining the exact type of user input for every argument \item Added total amount of explained variance as a caption in the plot \item Cleaned all syntax based on the \code{lintr} package, fixed grammatical errors and added integrity checks \item Updated documentation @@ -100,7 +100,7 @@ ggplot_pca( \item{base_textsize}{the text size for all plot elements except the labels and arrows} -\item{...}{Parameters passed on to functions} +\item{...}{Arguments passed on to functions} } \description{ Produces a \code{ggplot2} variant of a so-called \href{https://en.wikipedia.org/wiki/Biplot}{biplot} for PCA (principal component analysis), but is more flexible and more appealing than the base \R \code{\link[=biplot]{biplot()}} function. diff --git a/man/ggplot_rsi.Rd b/man/ggplot_rsi.Rd index b4ae8c2a..4e1023a1 100644 --- a/man/ggplot_rsi.Rd +++ b/man/ggplot_rsi.Rd @@ -89,9 +89,9 @@ labels_rsi_count( \item{translate_ab}{a column name of the \link{antibiotics} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} -\item{combine_SI}{a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is \code{TRUE}.} +\item{combine_SI}{a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the argument \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is \code{TRUE}.} -\item{combine_IR}{a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see parameter \code{combine_SI}.} +\item{combine_IR}{a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see argument \code{combine_SI}.} \item{minimum}{the minimum allowed number of available (tested) isolates. Any isolate count lower than \code{minimum} will return \code{NA} with a warning. The default number of \code{30} isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.} @@ -117,13 +117,13 @@ labels_rsi_count( \item{y.title}{text to show as y axis description} -\item{...}{other parameters passed on to \code{\link[=geom_rsi]{geom_rsi()}}} +\item{...}{other arguments passed on to \code{\link[=geom_rsi]{geom_rsi()}}} } \description{ Use these functions to create bar plots for antimicrobial resistance analysis. All functions rely on \link[ggplot2:ggplot]{ggplot2} functions. } \details{ -At default, the names of antibiotics will be shown on the plots using \code{\link[=ab_name]{ab_name()}}. This can be set with the \code{translate_ab} parameter. See \code{\link[=count_df]{count_df()}}. +At default, the names of antibiotics will be shown on the plots using \code{\link[=ab_name]{ab_name()}}. This can be set with the \code{translate_ab} argument. See \code{\link[=count_df]{count_df()}}. \subsection{The functions}{ \code{\link[=geom_rsi]{geom_rsi()}} will take any variable from the data that has an \code{\link{rsi}} class (created with \code{\link[=as.rsi]{as.rsi()}}) using \code{\link[=rsi_df]{rsi_df()}} and will plot bars with the percentage R, I and S. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis. @@ -178,7 +178,7 @@ if (require("ggplot2") & require("dplyr")) { select(AMX, NIT, FOS, TMP, CIP) \%>\% ggplot_rsi(datalabels = FALSE) - # add other ggplot2 parameters as you like: + # add other ggplot2 arguments as you like: example_isolates \%>\% select(AMX, NIT, FOS, TMP, CIP) \%>\% ggplot_rsi(width = 0.5, diff --git a/man/guess_ab_col.Rd b/man/guess_ab_col.Rd index c71636ee..9e0c606b 100644 --- a/man/guess_ab_col.Rd +++ b/man/guess_ab_col.Rd @@ -27,7 +27,7 @@ You can look for an antibiotic (trade) name or abbreviation and it will search \ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ diff --git a/man/is_new_episode.Rd b/man/is_new_episode.Rd index 2d9bc08e..591e49c9 100644 --- a/man/is_new_episode.Rd +++ b/man/is_new_episode.Rd @@ -17,7 +17,7 @@ is_new_episode(x, episode_days = 365, ...) a \link{logical} vector } \description{ -This function determines which items in a vector can be considered (the start of) a new episode, based on the parameter \code{episode_days}. This can be used to determine clinical episodes for any epidemiological analysis. +This function determines which items in a vector can be considered (the start of) a new episode, based on the argument \code{episode_days}. This can be used to determine clinical episodes for any epidemiological analysis. } \details{ Dates are first sorted from old to new. The oldest date will mark the start of the first episode. After this date, the next date will be marked that is at least \code{episode_days} days later than the start of the first episode. From that second marked date on, the next date will be marked that is at least \code{episode_days} days later than the start of the second episode which will be the start of the third episode, and so on. Before the vector is being returned, the original order will be restored. @@ -31,7 +31,7 @@ The \code{dplyr} package is not required for this function to work, but this fun \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ diff --git a/man/join.Rd b/man/join.Rd index d772f319..a938f872 100755 --- a/man/join.Rd +++ b/man/join.Rd @@ -45,7 +45,7 @@ If the \code{dplyr} package is installed, their join functions will be used. Oth \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ diff --git a/man/key_antibiotics.Rd b/man/key_antibiotics.Rd index 8e747281..aedeebf3 100755 --- a/man/key_antibiotics.Rd +++ b/man/key_antibiotics.Rd @@ -52,7 +52,7 @@ key_antibiotics_equal( \item{warnings}{give a warning about missing antibiotic columns (they will be ignored)} -\item{...}{other parameters passed on to functions} +\item{...}{other arguments passed on to functions} \item{y, z}{character vectors to compare} @@ -68,7 +68,7 @@ key_antibiotics_equal( These function can be used to determine first isolates (see \code{\link[=first_isolate]{first_isolate()}}). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates can then be called first \emph{weighted} isolates. } \details{ -The \code{\link[=key_antibiotics]{key_antibiotics()}} function is context-aware when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}. This means that then the \code{x} parameter can be omitted, please see \emph{Examples}. +The \code{\link[=key_antibiotics]{key_antibiotics()}} function is context-aware when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}. This means that then the \code{x} argument can be omitted, please see \emph{Examples}. The function \code{\link[=key_antibiotics]{key_antibiotics()}} returns a character vector with 12 antibiotic results for every isolate. These isolates can then be compared using \code{\link[=key_antibiotics_equal]{key_antibiotics_equal()}}, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot (\code{"."}) by \code{\link[=key_antibiotics]{key_antibiotics()}} and ignored by \code{\link[=key_antibiotics_equal]{key_antibiotics_equal()}}. @@ -113,17 +113,17 @@ The function \code{\link[=key_antibiotics_equal]{key_antibiotics_equal()}} check \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Key antibiotics}{ There are two ways to determine whether isolates can be included as first \emph{weighted} isolates which will give generally the same results: \enumerate{ -\item Using \code{type = "keyantibiotics"} and parameter \code{ignore_I} +\item Using \code{type = "keyantibiotics"} and argument \code{ignore_I} Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With \code{ignore_I = FALSE}, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. Read more about this in the \code{\link[=key_antibiotics]{key_antibiotics()}} function. -\item Using \code{type = "points"} and parameter \code{points_threshold} +\item Using \code{type = "points"} and argument \code{points_threshold} A difference from I to S|R (or vice versa) means 0.5 points, a difference from S to R (or vice versa) means 1 point. When the sum of points exceeds \code{points_threshold}, which default to \code{2}, an isolate will be (re)selected as a first weighted isolate. } diff --git a/man/kurtosis.Rd b/man/kurtosis.Rd index 0641c3b4..5fe01774 100644 --- a/man/kurtosis.Rd +++ b/man/kurtosis.Rd @@ -30,7 +30,7 @@ Kurtosis is a measure of the "tailedness" of the probability distribution of a r \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ diff --git a/man/lifecycle.Rd b/man/lifecycle.Rd index 1393763f..32dfaeac 100644 --- a/man/lifecycle.Rd +++ b/man/lifecycle.Rd @@ -26,7 +26,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{maturing}. The unly \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Retired lifecycle}{ diff --git a/man/like.Rd b/man/like.Rd index 8c26f939..06916cdb 100755 --- a/man/like.Rd +++ b/man/like.Rd @@ -44,7 +44,7 @@ Using RStudio? The text \verb{\%like\%} can also be directly inserted in your co \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ diff --git a/man/mdro.Rd b/man/mdro.Rd index aba17f78..1bfee4b0 100644 --- a/man/mdro.Rd +++ b/man/mdro.Rd @@ -72,7 +72,7 @@ Ordered \link{factor} with levels \code{Negative} < \verb{Positive, unconfirmed} Determine which isolates are multidrug-resistant organisms (MDRO) according to international and national guidelines. } \details{ -These functions are context-aware when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}. This means that then the \code{x} parameter can be omitted, please see \emph{Examples}. +These functions are context-aware when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}. This means that then the \code{x} argument can be omitted, please see \emph{Examples}. For the \code{pct_required_classes} argument, values above 1 will be divided by 100. This is to support both fractions (\code{0.75} or \code{3/4}) and percentages (\code{75}). @@ -107,7 +107,7 @@ Please suggest your own (country-specific) guidelines by letting us know: \url{h \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Antibiotics}{ diff --git a/man/mo_matching_score.Rd b/man/mo_matching_score.Rd index 91c7228f..9d469c15 100644 --- a/man/mo_matching_score.Rd +++ b/man/mo_matching_score.Rd @@ -40,7 +40,7 @@ All matches are sorted descending on their matching score and for all user input \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \examples{ diff --git a/man/mo_property.Rd b/man/mo_property.Rd index 5094696c..d0b467c8 100644 --- a/man/mo_property.Rd +++ b/man/mo_property.Rd @@ -89,7 +89,7 @@ mo_property(x, property = "fullname", language = get_locale(), ...) \item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can be overwritten by setting the option \code{AMR_locale}, e.g. \code{options(AMR_locale = "de")}, see \link{translate}. Also used to translate text like "no growth". Use \code{language = NULL} or \code{language = ""} to prevent translation.} -\item{...}{other parameters passed on to \code{\link[=as.mo]{as.mo()}}, such as 'allow_uncertain' and 'ignore_pattern'} +\item{...}{other arguments passed on to \code{\link[=as.mo]{as.mo()}}, such as 'allow_uncertain' and 'ignore_pattern'} \item{ab}{any (vector of) text that can be coerced to a valid antibiotic code with \code{\link[=as.ab]{as.ab()}}} @@ -123,7 +123,7 @@ Since the top-level of the taxonomy is sometimes referred to as 'kingdom' and so The Gram stain - \code{\link[=mo_gramstain]{mo_gramstain()}} - will be determined based on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002, \href{https://pubmed.ncbi.nlm.nih.gov/11837318}{PMID 11837318}), who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. These bacteria are considered Gram-positive - all other bacteria are considered Gram-negative. Species outside the kingdom of Bacteria will return a value \code{NA}. Functions \code{\link[=mo_is_gram_negative]{mo_is_gram_negative()}} and \code{\link[=mo_is_gram_positive]{mo_is_gram_positive()}} always return \code{TRUE} or \code{FALSE} (except when the input is \code{NA} or the MO code is \code{UNKNOWN}), thus always return \code{FALSE} for species outside the taxonomic kingdom of Bacteria. -Intrinsic resistance - \code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}} - will be determined based on the \link{intrinsic_resistant} data set, which is based on \href{https://www.eucast.org/expert_rules_and_intrinsic_resistance/}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.2} from 2020. The \code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}} can be vectorised over parameters \code{x} (input for microorganisms) and over \code{ab} (input for antibiotics). +Intrinsic resistance - \code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}} - will be determined based on the \link{intrinsic_resistant} data set, which is based on \href{https://www.eucast.org/expert_rules_and_intrinsic_resistance/}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.2} from 2020. The \code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}} can be vectorised over arguments \code{x} (input for microorganisms) and over \code{ab} (input for antibiotics). All output will be \link{translate}d where possible. @@ -134,7 +134,7 @@ The function \code{\link[=mo_url]{mo_url()}} will return the direct URL to the o \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Matching score for microorganisms}{ diff --git a/man/mo_source.Rd b/man/mo_source.Rd index 68b6f595..f8aef2b3 100644 --- a/man/mo_source.Rd +++ b/man/mo_source.Rd @@ -26,7 +26,7 @@ This is \strong{the fastest way} to have your organisation (or analysis) specifi \details{ The reference file can be a text file separated with commas (CSV) or tabs or pipes, an Excel file (either 'xls' or 'xlsx' format) or an \R object file (extension '.rds'). To use an Excel file, you will need to have the \code{readxl} package installed. -\code{\link[=set_mo_source]{set_mo_source()}} will check the file for validity: it must be a \link{data.frame}, must have a column named \code{"mo"} which contains values from \code{\link[=microorganisms]{microorganisms$mo}} and must have a reference column with your own defined values. If all tests pass, \code{\link[=set_mo_source]{set_mo_source()}} will read the file into \R and will ask to export it to \code{"~/mo_source.rds"}. The CRAN policy disallows packages to write to the file system, although '\emph{exceptions may be allowed in interactive sessions if the package obtains confirmation from the user}'. For this reason, this function only works in interactive sessions so that the user can \strong{specifically confirm and allow} that this file will be created. The destination of this file can be set with the \code{destination} parameter and defaults to the user's home directory. It can also be set as an \R option, using \code{options(AMR_mo_source = "my/location/file.rds")}. +\code{\link[=set_mo_source]{set_mo_source()}} will check the file for validity: it must be a \link{data.frame}, must have a column named \code{"mo"} which contains values from \code{\link[=microorganisms]{microorganisms$mo}} and must have a reference column with your own defined values. If all tests pass, \code{\link[=set_mo_source]{set_mo_source()}} will read the file into \R and will ask to export it to \code{"~/mo_source.rds"}. The CRAN policy disallows packages to write to the file system, although '\emph{exceptions may be allowed in interactive sessions if the package obtains confirmation from the user}'. For this reason, this function only works in interactive sessions so that the user can \strong{specifically confirm and allow} that this file will be created. The destination of this file can be set with the \code{destination} argument and defaults to the user's home directory. It can also be set as an \R option, using \code{options(AMR_mo_source = "my/location/file.rds")}. The created compressed data file \code{"mo_source.rds"} will be used at default for MO determination (function \code{\link[=as.mo]{as.mo()}} and consequently all \verb{mo_*} functions like \code{\link[=mo_genus]{mo_genus()}} and \code{\link[=mo_gramstain]{mo_gramstain()}}). The location and timestamp of the original file will be saved as an attribute to the compressed data file. @@ -100,7 +100,7 @@ If the original Excel file is moved or deleted, the mo_source file will be remov \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ diff --git a/man/plot.Rd b/man/plot.Rd index d0a86782..cec2df39 100644 --- a/man/plot.Rd +++ b/man/plot.Rd @@ -72,7 +72,7 @@ \item{axes}{logical. If \code{TRUE}, a vertical (or horizontal, if \code{horiz} is true) axis is drawn.} -\item{...}{Parameters passed on to functions} +\item{...}{Arguments passed on to functions} \item{height}{either a vector or matrix of values describing the bars which make up the plot. If \code{height} is a vector, the @@ -103,7 +103,7 @@ Functions to print classes of the \code{AMR} package. \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ diff --git a/man/proportion.Rd b/man/proportion.Rd index a8545e9a..8ecfc362 100644 --- a/man/proportion.Rd +++ b/man/proportion.Rd @@ -66,9 +66,9 @@ rsi_df( \item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} -\item{combine_SI}{a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is \code{TRUE}.} +\item{combine_SI}{a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the argument \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is \code{TRUE}.} -\item{combine_IR}{a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see parameter \code{combine_SI}.} +\item{combine_IR}{a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see argument \code{combine_SI}.} } \value{ A \link{double} or, when \code{as_percent = TRUE}, a \link{character}. @@ -83,7 +83,7 @@ The function \code{\link[=resistance]{resistance()}} is equal to the function \c \strong{Remember that you should filter your table to let it contain only first isolates!} This is needed to exclude duplicates and to reduce selection bias. Use \code{\link[=first_isolate]{first_isolate()}} to determine them in your data set. -These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the \code{\link[=count]{count()}} functions to count isolates. The function \code{\link[=susceptibility]{susceptibility()}} is essentially equal to \code{count_susceptible() / count_all()}. \emph{Low counts can influence the outcome - the \code{proportion} functions may camouflage this, since they only return the proportion (albeit being dependent on the \code{minimum} parameter).} +These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the \code{\link[=count]{count()}} functions to count isolates. The function \code{\link[=susceptibility]{susceptibility()}} is essentially equal to \code{count_susceptible() / count_all()}. \emph{Low counts can influence the outcome - the \code{proportion} functions may camouflage this, since they only return the proportion (albeit being dependent on the \code{minimum} argument).} The function \code{\link[=proportion_df]{proportion_df()}} takes any variable from \code{data} that has an \code{\link{rsi}} class (created with \code{\link[=as.rsi]{as.rsi()}}) and calculates the proportions R, I and S. It also supports grouped variables. The function \code{\link[=rsi_df]{rsi_df()}} works exactly like \code{\link[=proportion_df]{proportion_df()}}, but adds the number of isolates. } @@ -123,7 +123,7 @@ Using \code{only_all_tested} has no impact when only using one antibiotic as inp \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Interpretation of R and S/I}{ diff --git a/man/random.Rd b/man/random.Rd index fc21f042..338acf4a 100644 --- a/man/random.Rd +++ b/man/random.Rd @@ -33,7 +33,7 @@ These functions can be used for generating random MIC values and disk diffusion \details{ The base R function \code{\link[=sample]{sample()}} is used for generating values. -Generated values are based on the latest EUCAST guideline implemented in the \link{rsi_translation} data set. To create specific generated values per bug or drug, set the \code{mo} and/or \code{ab} parameter. +Generated values are based on the latest EUCAST guideline implemented in the \link{rsi_translation} data set. To create specific generated values per bug or drug, set the \code{mo} and/or \code{ab} argument. } \section{Maturing lifecycle}{ diff --git a/man/resistance_predict.Rd b/man/resistance_predict.Rd index 6bbe0b4f..6fec8877 100644 --- a/man/resistance_predict.Rd +++ b/man/resistance_predict.Rd @@ -69,7 +69,7 @@ ggplot_rsi_predict( \item{info}{a logical to indicate whether textual analysis should be printed with the name and \code{\link[=summary]{summary()}} of the statistical model.} -\item{...}{parameters passed on to functions} +\item{...}{arguments passed on to functions} \item{main}{title of the plot} @@ -93,7 +93,7 @@ Furthermore, the model itself is available as an attribute: \code{attributes(x)$ Create a prediction model to predict antimicrobial resistance for the next years on statistical solid ground. Standard errors (SE) will be returned as columns \code{se_min} and \code{se_max}. See \emph{Examples} for a real live example. } \details{ -Valid options for the statistical model (parameter \code{model}) are: +Valid options for the statistical model (argument \code{model}) are: \itemize{ \item \code{"binomial"} or \code{"binom"} or \code{"logit"}: a generalised linear regression model with binomial distribution \item \code{"loglin"} or \code{"poisson"}: a generalised log-linear regression model with poisson distribution diff --git a/man/skewness.Rd b/man/skewness.Rd index d26aaf4b..46bff595 100644 --- a/man/skewness.Rd +++ b/man/skewness.Rd @@ -30,7 +30,7 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ diff --git a/man/translate.Rd b/man/translate.Rd index dbea0763..172fd97b 100644 --- a/man/translate.Rd +++ b/man/translate.Rd @@ -32,7 +32,7 @@ So if the R option \code{AMR_locale} is set, the system variables \code{LANGUAGE \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. -If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ @@ -41,7 +41,7 @@ On our website \url{https://msberends.github.io/AMR/} you can find \href{https:/ } \examples{ -# The 'language' parameter of below functions +# The 'language' argument of below functions # will be set automatically to your system language # with get_locale() diff --git a/tests/testthat/test-rsi.R b/tests/testthat/test-rsi.R index 0179f720..6196b18f 100644 --- a/tests/testthat/test-rsi.R +++ b/tests/testthat/test-rsi.R @@ -26,6 +26,7 @@ context("rsi.R") test_that("rsi works", { + skip_on_cran() expect_true(as.rsi("S") < as.rsi("I")) @@ -83,7 +84,6 @@ test_that("rsi works", { }) - test_that("mic2rsi works", { skip_on_cran() @@ -115,19 +115,6 @@ test_that("mic2rsi works", { as.rsi() %>% pull(amox_mic) %>% is.rsi())) - - expect_warning(data.frame(mo = "E. coli", - NIT = c("<= 2", 32)) %>% - as.rsi()) - expect_message(data.frame(mo = "E. coli", - NIT = c("<= 2", 32), - uti = TRUE) %>% - as.rsi()) - expect_message( - data.frame(mo = "E. coli", - NIT = c("<= 2", 32), - specimen = c("urine", "blood")) %>% - as.rsi()) }) test_that("disk2rsi works", { @@ -160,11 +147,37 @@ test_that("disk2rsi works", { pull(amox_disk) %>% is.rsi()) - expect_s3_class(suppressWarnings(as.rsi(data.frame(mo = "Escherichia coli", - amoxi = c("R", "S", "I", "invalid")))$amoxi), "rsi") - # frequency tables if (require("cleaner")) { expect_s3_class(cleaner::freq(example_isolates$AMX), "freq") } }) + +test_that("data.frame2rsi works", { + + skip_on_cran() + + df <- data.frame(microorganism = "Escherichia coli", + AMP = as.mic(8), + CIP = as.mic(0.256), + GEN = as.disk(18), + TOB = as.disk(16), + ERY = "R", # note about assigningclass + CLR = "V") # note about cleaning + expect_s3_class(as.rsi(df), "data.frame") + + expect_s3_class(suppressWarnings(as.rsi(data.frame(mo = "Escherichia coli", + amoxi = c("R", "S", "I", "invalid")))$amoxi), "rsi") + expect_warning(data.frame(mo = "E. coli", + NIT = c("<= 2", 32)) %>% + as.rsi()) + expect_message(data.frame(mo = "E. coli", + NIT = c("<= 2", 32), + uti = TRUE) %>% + as.rsi()) + expect_message( + data.frame(mo = "E. coli", + NIT = c("<= 2", 32), + specimen = c("urine", "blood")) %>% + as.rsi()) +})