From b39055c01802a815a68400743ddf940e9f569bb0 Mon Sep 17 00:00:00 2001 From: "Matthijs S. Berends" Date: Sun, 27 Jan 2019 00:33:58 +0100 Subject: [PATCH] deprecated fix --- DESCRIPTION | 2 +- R/atc.R | 6 +- docs/index.html | 26 ++-- docs/news/index.html | 222 +++++------------------------ docs/pkgdown.yml | 2 +- docs/reference/AMR-deprecated.html | 8 +- docs/reference/as.atc.html | 6 +- docs/reference/index.html | 4 +- man/AMR-deprecated.Rd | 7 +- man/as.atc.Rd | 7 +- 10 files changed, 71 insertions(+), 219 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 18a7ad0f..c083bf68 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR Version: 0.5.0.9012 -Date: 2019-01-26 +Date: 2019-01-27 Title: Antimicrobial Resistance Analysis Authors@R: c( person( diff --git a/R/atc.R b/R/atc.R index b68461d7..4a6055ed 100755 --- a/R/atc.R +++ b/R/atc.R @@ -50,8 +50,8 @@ #' #' # Use ab_* functions to get a specific property based on an ATC code #' Cipro <- as.atc("cipro") # returns `J01MA02` -#' ab_official(Cipro) # returns "Ciprofloxacin" -#' ab_umcg(Cipro) # returns "CIPR", the code used in the UMCG +#' atc_official(Cipro) # returns "Ciprofloxacin" +#' atc_umcg(Cipro) # returns "CIPR", the code used in the UMCG as.atc <- function(x) { x.new <- rep(NA_character_, length(x)) @@ -146,7 +146,7 @@ as.atc <- function(x) { x.new } -#' @rdname as.atc +#' @rdname AMR-deprecated #' @export guess_atc <- as.atc diff --git a/docs/index.html b/docs/index.html index f4f8b940..4ab297a3 100644 --- a/docs/index.html +++ b/docs/index.html @@ -226,7 +226,7 @@

Get this package

This package is available on the official R network (CRAN), which has a peer-reviewed submission process. Install this package in R with:

-
install.packages("AMR")
+
install.packages("AMR")

It will be downloaded and installed automatically. For RStudio, click on the menu Tools > Install Packages… and then type in “AMR” and press Install.

@@ -259,17 +259,17 @@ Overview of functions

The AMR package basically does four important things:

    -
  1. -

    It cleanses existing data, by transforming it to reproducible and profound classes, making the most efficient use of R. These functions all use artificial intelligence to guess results that you would expect:

    +
  2. It cleanses existing data, by transforming it to reproducible and profound classes, making the most efficient use of R. These functions all use artificial intelligence to guess results that you would expect:
  3. +
- -
  • -

    It enhances existing data and adds new data from data sets included in this package.

    +
      +
    1. It enhances existing data and adds new data from data sets included in this package.
    2. +
    • Use eucast_rules() to apply EUCAST expert rules to isolates.
    • Use first_isolate() to identify the first isolates of every patient using guidelines from the CLSI (Clinical and Laboratory Standards Institute). @@ -281,9 +281,9 @@
    • The data set microorganisms contains the complete taxonomic tree of more than 18,000 microorganisms (bacteria, fungi/yeasts and protozoa). Furthermore, the colloquial name and Gram stain are available, which enables resistance analysis of e.g. different antibiotics per Gram stain. The package also contains functions to look up values in this data set like mo_genus(), mo_family(), mo_gramstain() or even mo_phylum(). As they use as.mo() internally, they also use artificial intelligence. For example, mo_genus("MRSA") and mo_genus("S. aureus") will both return "Staphylococcus". They also come with support for German, Dutch, Spanish, Italian, French and Portuguese. These functions can be used to add new variables to your data.
    • The data set antibiotics contains the ATC code, LIS codes, official name, trivial name and DDD of both oral and parenteral administration. It also contains a total of 298 trade names. Use functions like ab_name() and ab_tradenames() to look up values. The ab_* functions use as.atc() internally so they support AI to guess your expected result. For example, ab_name("Fluclox"), ab_name("Floxapen") and ab_name("J01CF05") will all return "Flucloxacillin". These functions can again be used to add new variables to your data.
    -
  • -
  • -

    It analyses the data with convenient functions that use well-known methods.

    +
      +
    1. It analyses the data with convenient functions that use well-known methods.
    2. +
    -
  • -
  • -

    It teaches the user how to use all the above actions.

    +
      +
    1. It teaches the user how to use all the above actions.
    2. +
    • The package contains extensive help pages with many examples.
    • It also contains an example data set called septic_patients. This data set contains: @@ -304,8 +304,6 @@
  • - -

    diff --git a/docs/news/index.html b/docs/news/index.html index aa73431e..1b838183 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -229,22 +229,10 @@

    @@ -282,17 +257,13 @@ These functions use as.atc()
  • Function atc_groups has been renamed atc_online_groups()
  • -
  • Function eucast_rules(): -
      +
    • Function eucast_rules():
    • Updated EUCAST Clinical breakpoints to version 9.0 of 1 January 2019
    • Fixed a critical bug where some rules that depend on previous applied rules would not be applied adequately
    • Emphasised in manual that penicillin is meant as benzylpenicillin (ATC J01CE01)
    • -
    -
  • Function guess_mo() is now deprecated in favour of as.mo() and will be removed in future versions
  • -
  • Improvements for as.mo(): -
      +
    • Improvements for as.mo():
    • Fix for vector containing only empty values
    • Finds better results when input is in other languages
    • Better handling for subspecies
    • @@ -303,17 +274,12 @@ These functions use as.atc()
    • Progress bar will be shown when it takes more than 3 seconds to get results
    • Support for formatted console text
    • Console will return the percentage of uncoercable input
    • -
    -
  • -
  • Function first_isolate(): -
      +
    • 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
    • -
    -
  • 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)
  • Merged data sets microorganisms.certe and microorganisms.umcg into microorganisms.codes
  • @@ -324,8 +290,7 @@ These functions use as.atc()
  • Small text updates to summaries of class rsi and mic
  • -
  • Frequency tables (freq() function): -
      +
    • Frequency tables (freq() function):
    • Header info is now available as a list, with the header function
    • 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") @@ -336,8 +301,6 @@ These functions use as.atc()
    • New parameter 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
    • -
    -
  • Function scale_y_percent() now contains the limits parameter
  • Automatic parameter filling for mdro(), key_antibiotics() and eucast_rules()
  • @@ -379,8 +342,7 @@ These functions use as.atc()
  • EUCAST_rules was renamed to eucast_rules, the old function still exists as a deprecated function
  • -
  • Big changes to the eucast_rules function: -
      +
    • Big changes to the eucast_rules function:
    • Now also applies rules from the EUCAST ‘Breakpoint tables for bacteria’, version 8.1, 2018, http://www.eucast.org/clinical_breakpoints/ (see Source of the function)
    • New parameter rules to specify which rules should be applied (expert rules, breakpoints, others or all)
    • New parameter verbose which can be set to TRUE to get very specific messages about which columns and rows were affected
    • @@ -389,18 +351,11 @@ These functions use as.atc()
    • Data set septic_patients now reflects these changes
    • Added parameter pipe for piperacillin (J01CA12), also to the mdro function
    • Small fixes to EUCAST clinical breakpoint rules
    • -
    -
  • Added column kingdom to the microorganisms data set, and function mo_kingdom to look up values
  • Tremendous speed improvement for as.mo (and subsequently all mo_* functions), as empty values wil be ignored a priori
  • Fewer than 3 characters as input for as.mo will return NA
  • -
  • -

    Function as.mo (and all mo_* wrappers) now supports genus abbreviations with “species” attached

    -
    as.mo("E. species")        # B_ESCHR
    -mo_fullname("E. spp.")     # "Escherichia species"
    -as.mo("S. spp")            # B_STPHY
    -mo_fullname("S. species")  # "Staphylococcus species"
    +
  • Function as.mo (and all mo_* wrappers) now supports genus abbreviations with “species” attached r as.mo("E. species") # B_ESCHR mo_fullname("E. spp.") # "Escherichia species" as.mo("S. spp") # B_STPHY mo_fullname("S. species") # "Staphylococcus species"
  • Added 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)
  • Fix for portion_*(..., as_percent = TRUE) when minimal number of isolates would not be met
  • @@ -409,19 +364,18 @@ These functions use as.atc()
  • Using portion_* functions now throws a warning when total available isolate is below parameter minimum
  • Functions as.mo, as.rsi, as.mic, as.atc and freq will not set package name as attribute anymore
  • -
  • Frequency tables - freq(): - -
  • first_isolate now tries to find columns to use as input when parameters are left blank
  • Improvements for MDRO algorithm (function mdro)
  • @@ -445,8 +397,7 @@ These functions use as.atc()
  • ggplot_rsi and scale_y_percent have breaks parameter
  • -
  • AI improvements for as.mo: -
      +
    • AI improvements for as.mo:
    • "CRS" -> Stenotrophomonas maltophilia
    • @@ -459,8 +410,6 @@ These functions use as.atc()
    • "MSSE" -> Staphylococcus epidermidis
    • -
    -
  • Fix for join functions
  • Speed improvement for is.rsi.eligible, now 15-20 times faster
  • In g.test, when sum(x) is below 1000 or any of the expected values is below 5, Fisher’s Exact Test will be suggested
  • @@ -489,8 +438,7 @@ These functions use as.atc() New

    @@ -624,21 +508,15 @@ These functions use as.atc() New

    - -
  • Determining bacterial ID: -
      +
    • Determining bacterial ID:
    • New functions as.bactid and is.bactid to transform/ look up microbial ID’s.
    • The existing function guess_bactid is now an alias of as.bactid
    • New Becker classification for Staphylococcus to categorise them into Coagulase Negative Staphylococci (CoNS) and Coagulase Positve Staphylococci (CoPS)
    • New Lancefield classification for Streptococcus to categorise them into Lancefield groups
    • -
    -
  • For convience, new descriptive statistical functions kurtosis and skewness that are lacking in base R - they are generic functions and have support for vectors, data.frames and matrices
  • Function g.test to perform the Χ2 distributed G-test, which use is the same as chisq.test
  • -
  • -Function ratio to transform a vector of values to a preset ratio - -
  • Support for Addins menu in RStudio to quickly insert %in% or %like% (and give them keyboard shortcuts), or to view the datasets that come with this package
  • Function p.symbol to transform p values to their related symbols: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  • Functions clipboard_import and clipboard_export as helper functions to quickly copy and paste from/to software like Excel and SPSS. These functions use the clipr package, but are a little altered to also support headless Linux servers (so you can use it in RStudio Server)
  • -
  • New for frequency tables (function freq): -
      +
    • New for frequency tables (function freq):
    • A vignette to explain its usage
    • Support for rsi (antimicrobial resistance) to use as input
    • Support for table to use as input: freq(table(x, y)) @@ -689,8 +557,6 @@ These functions use as.atc()
    • Header of frequency tables now also show Mean Absolute Deviaton (MAD) and Interquartile Range (IQR)
    • Possibility to globally set the default for the amount of items to print, with options(max.print.freq = n) where n is your preset value
    -
  • -

    @@ -712,27 +578,21 @@ These functions use as.atc()
  • Small improvements to the microorganisms dataset (especially for Salmonella) and the column bactid now has the new class "bactid"
  • -
  • Combined MIC/RSI values will now be coerced by the rsi and mic functions: - -
  • Now possible to coerce MIC values with a space between operator and value, i.e. as.mic("<= 0.002") now works
  • Classes rsi and mic do not add the attribute package.version anymore
  • Added "groups" option for atc_property(..., property). It will return a vector of the ATC hierarchy as defined by the WHO. The new function atc_groups is a convenient wrapper around this.
  • Build-in host check for atc_property as it requires the host set by url to be responsive
  • Improved first_isolate algorithm to exclude isolates where bacteria ID or genus is unavailable
  • Fix for warning hybrid evaluation forced for row_number (924b62) from the dplyr package v0.7.5 and above
  • -
  • Support for empty values and for 1 or 2 columns as input for guess_bactid (now called as.bactid) -
      +
    • Support for empty values and for 1 or 2 columns as input for guess_bactid (now called as.bactid)
    • So yourdata %>% select(genus, species) %>% as.bactid() now also works
    • -
    -
  • Other small fixes
  • @@ -740,14 +600,11 @@ These functions use as.atc()

    Other

    @@ -766,13 +623,10 @@ These functions use as.atc()
  • Function guess_bactid to determine the ID of a microorganism based on genus/species or known abbreviations like MRSA
  • Function guess_atc to determine the ATC of an antibiotic based on name, trade name, or known abbreviations
  • Function freq to create frequency tables, with additional info in a header
  • -
  • Function MDRO to determine Multi Drug Resistant Organisms (MDRO) with support for country-specific guidelines. - -
  • New algorithm to determine weighted isolates, can now be "points" or "keyantibiotics", see ?first_isolate
  • New print format for tibbles and data.tables
  • diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 31227eab..3c396dbb 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,4 +1,4 @@ -pandoc: 2.3.1 +pandoc: 1.17.2 pkgdown: 1.3.0 pkgdown_sha: ~ articles: diff --git a/docs/reference/AMR-deprecated.html b/docs/reference/AMR-deprecated.html index 600851b2..52b83fd4 100644 --- a/docs/reference/AMR-deprecated.html +++ b/docs/reference/AMR-deprecated.html @@ -6,7 +6,7 @@ -Deprecated functions — AMR-deprecated • AMR (for R) +Deprecated functions — guess_atc • AMR (for R) @@ -45,7 +45,7 @@ - + @@ -227,7 +227,9 @@ -
    ratio(x, ratio)
    +    
    guess_atc(x)
    +
    +ratio(x, ratio)
     
     guess_mo(...)
     
    diff --git a/docs/reference/as.atc.html b/docs/reference/as.atc.html
    index 6862575f..0aa295b2 100644
    --- a/docs/reference/as.atc.html
    +++ b/docs/reference/as.atc.html
    @@ -229,8 +229,6 @@
     
         
    as.atc(x)
     
    -guess_atc(x)
    -
     is.atc(x)

    Arguments

    @@ -286,8 +284,8 @@ On our website https://msberends.gitla # Use ab_* functions to get a specific property based on an ATC code Cipro <- as.atc("cipro") # returns `J01MA02` -ab_official(Cipro) # returns "Ciprofloxacin" -ab_umcg(Cipro) # returns "CIPR", the code used in the UMCG +atc_official(Cipro) # returns "Ciprofloxacin" +atc_umcg(Cipro) # returns "CIPR", the code used in the UMCG # }