diff --git a/DESCRIPTION b/DESCRIPTION index 1f5d7d95..fb309447 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 1.6.0.9011 +Version: 1.6.0.9012 Date: 2021-04-27 Title: Antimicrobial Resistance Data Analysis Authors@R: c( diff --git a/NEWS.md b/NEWS.md index dfec6e0a..b23286fd 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 1.6.0.9011 +# AMR 1.6.0.9012 ## Last updated: 27 April 2021 ### New diff --git a/R/episode.R b/R/episode.R index 6ff9576c..cfcd7998 100644 --- a/R/episode.R +++ b/R/episode.R @@ -88,7 +88,8 @@ #' # grouping on patients and microorganisms leads to the same results #' # as first_isolate(): #' x <- example_isolates %>% -#' filter_first_isolate(include_unknown = TRUE) +#' filter_first_isolate(include_unknown = TRUE, +#' method = "episode-based") #' #' y <- example_isolates %>% #' group_by(patient_id, mo) %>% diff --git a/data-raw/AMR_latest.tar.gz b/data-raw/AMR_latest.tar.gz index 49d17501..3aeb6ccf 100644 Binary files a/data-raw/AMR_latest.tar.gz and b/data-raw/AMR_latest.tar.gz differ diff --git a/docs/404.html b/docs/404.html index 6b5c33d6..c79d709e 100644 --- a/docs/404.html +++ b/docs/404.html @@ -81,7 +81,7 @@ AMR (for R) - 1.6.0.9011 + 1.6.0.9012 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 5677604b..91457d43 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -81,7 +81,7 @@ AMR (for R) - 1.6.0.9011 + 1.6.0.9012 diff --git a/docs/articles/index.html b/docs/articles/index.html index 35a7040f..08cad4f6 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.6.0.9011 + 1.6.0.9012 diff --git a/docs/authors.html b/docs/authors.html index 09a1da09..6f5497f5 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -81,7 +81,7 @@ AMR (for R) - 1.6.0.9011 + 1.6.0.9012 diff --git a/docs/index.html b/docs/index.html index e41e66bf..0f9326ff 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@ AMR (for R) - 1.6.0.9011 + 1.6.0.9012 diff --git a/docs/news/index.html b/docs/news/index.html index d02a0f82..62814fb4 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.6.0.9011 + 1.6.0.9012 @@ -236,9 +236,9 @@ Source: NEWS.md -
-

-AMR 1.6.0.9011 Unreleased +
+

+AMR 1.6.0.9012 Unreleased

@@ -338,7 +338,7 @@
  • Support for custom MDRO guidelines, using the new custom_mdro_guideline() function, please see mdro() for additional info
  • -ggplot() generics for classes <mic> and <disk> +ggplot() generics for classes <mic> and <disk>
  • Function mo_is_yeast(), which determines whether a microorganism is a member of the taxonomic class Saccharomycetes or the taxonomic order Saccharomycetales:

    @@ -393,7 +393,7 @@
  • Plotting of MIC and disk diffusion values now support interpretation colouring if you supply the microorganism and antimicrobial agent
  • All colours were updated to colour-blind friendly versions for values R, S and I for all plot methods (also applies to tibble printing)
  • Interpretation of MIC and disk diffusion values to R/SI will now be translated if the system language is German, Dutch or Spanish (see translate)
  • -
  • Plotting is now possible with base R using plot() and with ggplot2 using ggplot() on any vector of MIC and disk diffusion values
  • +
  • Plotting is now possible with base R using plot() and with ggplot2 using ggplot() on any vector of MIC and disk diffusion values
  • Updated SNOMED codes to US Edition of SNOMED CT from 1 September 2020 and added the source to the help page of the microorganisms data set
  • @@ -410,7 +410,7 @@ is.rsi.eligible() now detects if the column name resembles an antibiotic name or code and now returns TRUE immediately if the input contains any of the values “R”, “S” or “I”. This drastically improves speed, also for a lot of other functions that rely on automatic determination of antibiotic columns.
  • Functions get_episode() and is_new_episode() now support less than a day as value for argument episode_days (e.g., to include one patient/test per hour)
  • Argument ampc_cephalosporin_resistance in eucast_rules() now also applies to value “I” (not only “S”)
  • -
  • Functions print() and summary() on a Principal Components Analysis object (pca()) now print additional group info if the original data was grouped using dplyr::group_by() +
  • Functions print() and summary() on a Principal Components Analysis object (pca()) now print additional group info if the original data was grouped using dplyr::group_by()
  • Improved speed and reliability of guess_ab_col(). As this also internally improves the reliability of first_isolate() and mdro(), this might have a slight impact on the results of those functions.
  • Fix for mo_name() when used in other languages than English
  • @@ -748,7 +748,7 @@ As a consequence, very old microbial codes (from AMR v0.5.0 and low

    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:
      -
    • Function freq() that was borrowed from the cleaner package was removed. Use cleaner::freq(), or run library("cleaner") before you use freq().
    • +
    • Function freq() that was borrowed from the cleaner package was removed. Use cleaner::freq(), or run library("cleaner") before you use freq().
    • Printing values of class 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.
    • All functions from the mo_* family (like mo_name() and mo_gramstain()) are noticeably slower when running on hundreds of thousands of rows.
    • For developers: classes mo and ab now both also inherit class character, to support any data transformation. This change invalidates code that checks for class length == 1.
    • @@ -1073,7 +1073,7 @@ For WHONET users, this means that all records/isolates with organism code #> Warning message: #> invalid microorganism code, NA generated

    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

  • @@ -1335,7 +1335,7 @@ Since this is a major change, usage of the old also_single_tested w
  • 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
    • @@ -1344,12 +1344,12 @@ Since this is a major change, usage of the old also_single_tested w

      support for boxplots:

       septic_patients %>% 
      -  freq(age) %>% 
      +  freq(age) %>% 
         boxplot()
       # grouped boxplots:
       septic_patients %>% 
         group_by(hospital_id) %>% 
      -  freq(age) %>%
      +  freq(age) %>%
         boxplot()
    @@ -1359,7 +1359,7 @@ Since this is a major change, usage of the old also_single_tested w
  • 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() @@ -1590,7 +1590,7 @@ Using as.mo(..., allow_uncertain = 3)
  • -
  • Frequency tables (freq() function): +
  • Frequency tables (freq() function):
  • + freq(mo_genus(mo))
  • Header info is now available as a list, with the header function
  • The argument header is now set to TRUE at default, even for markdown
  • @@ -1694,20 +1694,20 @@ Using as.mo(..., allow_uncertain = 3)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:

       septic_patients %>% 
         group_by(hospital_id) %>% 
      -  freq(gender)
      + freq(gender)
    • Support for (un)selecting columns:

       septic_patients %>% 
      -  freq(hospital_id) %>% 
      +  freq(hospital_id) %>% 
         select(-count, -cum_count) # only get item, percent, cum_percent
    • Check for hms::is.hms @@ -1728,7 +1728,7 @@ Using as.mo(..., allow_uncertain = 3)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() +
    • Support for named vectors of class mo, useful for top_freq()
    • ggplot_rsi and scale_y_percent have breaks argument
    • @@ -1893,12 +1893,12 @@ Using as.mo(..., allow_uncertain = 3)Support for types (classes) list and matrix for freq

       my_matrix = with(septic_patients, matrix(c(age, gender), ncol = 2))
      -freq(my_matrix)
      +freq(my_matrix)

      For lists, subsetting is possible:

       my_list = list(age = septic_patients$age, gender = septic_patients$gender)
      -my_list %>% freq(age)
      -my_list %>% freq(gender)
      +my_list %>% freq(age) +my_list %>% freq(gender)
    @@ -1972,13 +1972,13 @@ Using as.mo(..., allow_uncertain = 3)
  • 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)) +
  • Support for table to use as input: freq(table(x, y))
  • Support for existing functions hist and plot to use a frequency table as input: hist(freq(df$age))
  • Support for as.vector, as.data.frame, as_tibble and format
  • -
  • Support for quasiquotation: freq(mydata, mycolumn) is the same as mydata %>% freq(mycolumn) +
  • Support for quasiquotation: freq(mydata, mycolumn) is the same as mydata %>% freq(mycolumn)
  • Function top_freq function to return the top/below n items as vector
  • Header of frequency tables now also show Mean Absolute Deviaton (MAD) and Interquartile Range (IQR)
  • diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 8446a735..49087b51 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -12,7 +12,7 @@ articles: datasets: datasets.html resistance_predict: resistance_predict.html welcome_to_AMR: welcome_to_AMR.html -last_built: 2021-04-27T08:22Z +last_built: 2021-04-27T09:08Z urls: reference: https://msberends.github.io/AMR//reference article: https://msberends.github.io/AMR//articles diff --git a/docs/reference/get_episode.html b/docs/reference/get_episode.html index e9078bb1..8d4bfff6 100644 --- a/docs/reference/get_episode.html +++ b/docs/reference/get_episode.html @@ -82,7 +82,7 @@ AMR (for R) - 1.6.0.9011 + 1.6.0.9012 @@ -337,7 +337,8 @@ The lifecycle of this function is stable# grouping on patients and microorganisms leads to the same results # as first_isolate(): x <- example_isolates %>% - filter_first_isolate(include_unknown = TRUE) + filter_first_isolate(include_unknown = TRUE, + method = "episode-based") y <- example_isolates %>% group_by(patient_id, mo) %>% diff --git a/docs/reference/index.html b/docs/reference/index.html index 0d6c456f..6d86117e 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.6.0.9011 + 1.6.0.9012 diff --git a/docs/survey.html b/docs/survey.html index 1205a9b3..d17d3e5c 100644 --- a/docs/survey.html +++ b/docs/survey.html @@ -81,7 +81,7 @@ AMR (for R) - 1.6.0.9011 + 1.6.0.9012 diff --git a/man/get_episode.Rd b/man/get_episode.Rd index 379af4f6..93b39d4f 100644 --- a/man/get_episode.Rd +++ b/man/get_episode.Rd @@ -90,7 +90,8 @@ if (require("dplyr")) { # grouping on patients and microorganisms leads to the same results # as first_isolate(): x <- example_isolates \%>\% - filter_first_isolate(include_unknown = TRUE) + filter_first_isolate(include_unknown = TRUE, + method = "episode-based") y <- example_isolates \%>\% group_by(patient_id, mo) \%>\% diff --git a/tests/testthat/test-episode.R b/tests/testthat/test-episode.R index f2250166..fc27b40c 100644 --- a/tests/testthat/test-episode.R +++ b/tests/testthat/test-episode.R @@ -47,7 +47,7 @@ test_that("episodes work", { suppressMessages( x <- example_isolates %>% - mutate(out = first_isolate(., include_unknown = TRUE, info = FALSE)) + mutate(out = first_isolate(., include_unknown = TRUE, method = "episode-based", info = FALSE)) ) y <- example_isolates %>%