diff --git a/.Rbuildignore b/.Rbuildignore old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.travis.yml b/.travis.yml old mode 100644 new mode 100755 index 4be52271..5c25fea8 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,3 @@ -# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r - # Setting up R deps language: r r: 3.2 @@ -10,10 +8,11 @@ cache: packages os: - linux - osx -before_install: - - if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get -qq update; fi - - if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get install -y xclip; fi - - if [ $TRAVIS_OS_NAME = osx ]; then brew install xclip; fi +#before_install: +# # needed for clipboard function: +# - if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get -qq update; fi +# - if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get install -y xclip; fi +# - if [ $TRAVIS_OS_NAME = osx ]; then brew install xclip; fi # postrun after_success: @@ -22,6 +21,6 @@ notifications: email: recipients: - m.s.berends@umcg.nl - - c.f.luz@umcg.nl + # - c.f.luz@umcg.nl on_success: change on_failure: change diff --git a/DESCRIPTION b/DESCRIPTION old mode 100644 new mode 100755 index 26eb8ac1..3f40d08a --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR Version: 0.2.0.9000 -Date: 2018-05-09 +Date: 2018-05-22 Title: Antimicrobial Resistance Analysis Authors@R: c( person( diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/NAMESPACE b/NAMESPACE old mode 100644 new mode 100755 diff --git a/NEWS.md b/NEWS.md old mode 100644 new mode 100755 index afacac0b..4fbd454b --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# 0.2.9000 (development version) +# 0.2.0.9000 (development version) #### New * Vignettes about frequency tables * Possibility to globally set the default for the amount of items to print in frequency tables (`freq` function), with `options(max.print.freq = n)` diff --git a/R/atc.R b/R/atc.R old mode 100644 new mode 100755 diff --git a/R/classes.R b/R/classes.R old mode 100644 new mode 100755 diff --git a/R/data.R b/R/data.R old mode 100644 new mode 100755 diff --git a/R/eucast.R b/R/eucast.R old mode 100644 new mode 100755 diff --git a/R/first_isolates.R b/R/first_isolates.R old mode 100644 new mode 100755 diff --git a/R/freq.R b/R/freq.R old mode 100644 new mode 100755 index 00a791ad..dbbc1e7b --- a/R/freq.R +++ b/R/freq.R @@ -21,7 +21,7 @@ #' Create a frequency table of a vector of data, a single column or a maximum of 9 columns of a data frame. Supports markdown for reports. #' @param x data #' @param sort.count Sort on count. Use \code{FALSE} to sort alphabetically on item. -#' @param nmax number of row to print. The default, \code{15}, uses \code{\link[base]{getOption}("max.print.freq")}. Use \code{nmax = 0} or \code{nmax = NA} to print all rows. +#' @param nmax number of row to print. The default, \code{15}, uses \code{\link{getOption}("max.print.freq")}. Use \code{nmax = 0} or \code{nmax = NA} to print all rows. #' @param na.rm a logical value indicating whether NA values should be removed from the frequency table. The header will always print the amount of \code{NA}s. #' @param markdown print table in markdown format (this forces \code{nmax = NA}) #' @param as.data.frame return frequency table without header as a \code{data.frame} (e.g. to assign the table to an object) @@ -337,18 +337,18 @@ freq <- function(x, align = column_align, padding = 1) ) - cat('... and ', - format(nrow(df) - nmax), - ' more ', - paste0('(n = ', - format(Count.rest), - '; ', - (Count.rest / length(x)) %>% percent(force_zero = TRUE), - ')'), - '.', sep = '') - if (nmax.set == FALSE) { - cat(' Use `nmax` to show more or less rows.') + if (nmax.set == TRUE) { + cat('[ reached `nmax = ', nmax, '`', sep = '') + } else { + cat('[ reached getOption("max.print.freq")') } + cat(' -- omitted ', + format(nrow(df) - nmax), + ' entries, n = ', + format(Count.rest), + ' (', + (Count.rest / length(x)) %>% percent(force_zero = TRUE), + ') ]\n', sep = '') cat('\n') } else { diff --git a/R/globals.R b/R/globals.R old mode 100644 new mode 100755 diff --git a/R/join.R b/R/join.R old mode 100644 new mode 100755 diff --git a/R/mdro.R b/R/mdro.R old mode 100644 new mode 100755 diff --git a/R/misc.R b/R/misc.R old mode 100644 new mode 100755 diff --git a/R/print.R b/R/print.R old mode 100644 new mode 100755 diff --git a/R/rsi_analysis.R b/R/rsi_analysis.R old mode 100644 new mode 100755 diff --git a/R/zzz.R b/R/zzz.R old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/_config.yml b/_config.yml deleted file mode 100644 index c4192631..00000000 --- a/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-cayman \ No newline at end of file diff --git a/data/antibiotics.rda b/data/antibiotics.rda old mode 100644 new mode 100755 diff --git a/data/microorganisms.rda b/data/microorganisms.rda old mode 100644 new mode 100755 diff --git a/data/microorganisms.umcg.rda b/data/microorganisms.umcg.rda old mode 100644 new mode 100755 diff --git a/data/septic_patients.rda b/data/septic_patients.rda old mode 100644 new mode 100755 diff --git a/man/EUCAST.Rd b/man/EUCAST.Rd old mode 100644 new mode 100755 diff --git a/man/MDRO.Rd b/man/MDRO.Rd old mode 100644 new mode 100755 diff --git a/man/abname.Rd b/man/abname.Rd old mode 100644 new mode 100755 diff --git a/man/antibiotics.Rd b/man/antibiotics.Rd old mode 100644 new mode 100755 diff --git a/man/as.mic.Rd b/man/as.mic.Rd old mode 100644 new mode 100755 diff --git a/man/as.rsi.Rd b/man/as.rsi.Rd old mode 100644 new mode 100755 diff --git a/man/atc_property.Rd b/man/atc_property.Rd old mode 100644 new mode 100755 diff --git a/man/figures/combi_therapy_2.png b/man/figures/combi_therapy_2.png old mode 100644 new mode 100755 diff --git a/man/figures/combi_therapy_3.png b/man/figures/combi_therapy_3.png old mode 100644 new mode 100755 diff --git a/man/figures/logo_certe.png b/man/figures/logo_certe.png old mode 100644 new mode 100755 diff --git a/man/figures/logo_eh1h.png b/man/figures/logo_eh1h.png old mode 100644 new mode 100755 diff --git a/man/figures/logo_interreg.png b/man/figures/logo_interreg.png old mode 100644 new mode 100755 diff --git a/man/figures/logo_rug.png b/man/figures/logo_rug.png old mode 100644 new mode 100755 diff --git a/man/figures/logo_umcg.png b/man/figures/logo_umcg.png old mode 100644 new mode 100755 diff --git a/man/figures/mic_example.png b/man/figures/mic_example.png old mode 100644 new mode 100755 diff --git a/man/figures/mono_therapy.png b/man/figures/mono_therapy.png old mode 100644 new mode 100755 diff --git a/man/figures/rsi_example.png b/man/figures/rsi_example.png old mode 100644 new mode 100755 diff --git a/man/first_isolate.Rd b/man/first_isolate.Rd old mode 100644 new mode 100755 diff --git a/man/freq.Rd b/man/freq.Rd old mode 100644 new mode 100755 index a50bb03e..32f30029 --- a/man/freq.Rd +++ b/man/freq.Rd @@ -18,7 +18,7 @@ frequency_tbl(x, sort.count = TRUE, nmax = getOption("max.print.freq"), \item{sort.count}{Sort on count. Use \code{FALSE} to sort alphabetically on item.} -\item{nmax}{number of row to print. The default, \code{15}, uses \code{\link[base]{getOption}("max.print.freq")}. Use \code{nmax = 0} or \code{nmax = NA} to print all rows.} +\item{nmax}{number of row to print. The default, \code{15}, uses \code{\link{getOption}("max.print.freq")}. Use \code{nmax = 0} or \code{nmax = NA} to print all rows.} \item{na.rm}{a logical value indicating whether NA values should be removed from the frequency table. The header will always print the amount of \code{NA}s.} diff --git a/man/guess_atc.Rd b/man/guess_atc.Rd old mode 100644 new mode 100755 diff --git a/man/guess_bactid.Rd b/man/guess_bactid.Rd old mode 100644 new mode 100755 diff --git a/man/join.Rd b/man/join.Rd old mode 100644 new mode 100755 diff --git a/man/key_antibiotics.Rd b/man/key_antibiotics.Rd old mode 100644 new mode 100755 diff --git a/man/like.Rd b/man/like.Rd old mode 100644 new mode 100755 diff --git a/man/microorganisms.Rd b/man/microorganisms.Rd old mode 100644 new mode 100755 diff --git a/man/microorganisms.umcg.Rd b/man/microorganisms.umcg.Rd old mode 100644 new mode 100755 diff --git a/man/mo_property.Rd b/man/mo_property.Rd old mode 100644 new mode 100755 diff --git a/man/print.Rd b/man/print.Rd old mode 100644 new mode 100755 diff --git a/man/rsi.Rd b/man/rsi.Rd old mode 100644 new mode 100755 diff --git a/man/rsi_predict.Rd b/man/rsi_predict.Rd old mode 100644 new mode 100755 diff --git a/man/septic_patients.Rd b/man/septic_patients.Rd old mode 100644 new mode 100755 diff --git a/tests/testthat.R b/tests/testthat.R old mode 100644 new mode 100755 diff --git a/tests/testthat/test-atc.R b/tests/testthat/test-atc.R old mode 100644 new mode 100755 diff --git a/tests/testthat/test-classes.R b/tests/testthat/test-classes.R old mode 100644 new mode 100755 diff --git a/tests/testthat/test-eucast.R b/tests/testthat/test-eucast.R old mode 100644 new mode 100755 diff --git a/tests/testthat/test-first_isolates.R b/tests/testthat/test-first_isolates.R old mode 100644 new mode 100755 diff --git a/tests/testthat/test-freq.R b/tests/testthat/test-freq.R old mode 100644 new mode 100755 diff --git a/tests/testthat/test-joins.R b/tests/testthat/test-joins.R old mode 100644 new mode 100755 diff --git a/tests/testthat/test-mdro.R b/tests/testthat/test-mdro.R old mode 100644 new mode 100755 diff --git a/tests/testthat/test-misc.R b/tests/testthat/test-misc.R old mode 100644 new mode 100755 diff --git a/tests/testthat/test-print.R b/tests/testthat/test-print.R old mode 100644 new mode 100755 diff --git a/tests/testthat/test-rsi_analysis.R b/tests/testthat/test-rsi_analysis.R old mode 100644 new mode 100755 index 3077987f..215dfccb --- a/tests/testthat/test-rsi_analysis.R +++ b/tests/testthat/test-rsi_analysis.R @@ -2,12 +2,12 @@ context("rsi_analysis.R") test_that("rsi works", { # amox resistance in `septic_patients` should be around 53.86% - expect_equal(rsi(septic_patients$amox), 0.5386, tolerance = 0.0001) - expect_equal(rsi(septic_patients$amox), 0.5386, tolerance = 0.0001) + expect_equal(rsi(septic_patients$amox), 0.5756, tolerance = 0.0001) + expect_equal(rsi(septic_patients$amox), 0.5756, tolerance = 0.0001) expect_equal(rsi_df(septic_patients, ab = "amox", info = FALSE), - 0.5386, + 0.5756, tolerance = 0.0001) # pita+genta susceptibility around 98.09% expect_equal(rsi(septic_patients$pita, diff --git a/vignettes/.gitignore b/vignettes/.gitignore old mode 100644 new mode 100755 diff --git a/vignettes/freq.R b/vignettes/freq.R old mode 100644 new mode 100755 diff --git a/vignettes/freq.Rmd b/vignettes/freq.Rmd old mode 100644 new mode 100755 index 04702aac..f8c2a14c --- a/vignettes/freq.Rmd +++ b/vignettes/freq.Rmd @@ -105,7 +105,7 @@ So for example, the above frequency table quickly shows the median age of patien Frequencies of factors will be sorted on factor level instead of item count by default. This can be changed with the `sort.count` parameter. Frequency tables of factors always show the factor level as an additional last column. -`sort.count` is `TRUE` by default, except for factors. Compare this default behaviour: +`sort.count` is `TRUE` by default, except for factors. Compare this default behaviour... ```{r, echo = TRUE} septic_patients %>% @@ -113,7 +113,7 @@ septic_patients %>% freq() ``` -To this, where items are now sorted on item count: +... with this, where items are now sorted on count: ```{r, echo = TRUE} septic_patients %>%