diff --git a/.Rbuildignore b/.Rbuildignore index 9b3d21e..83c5480 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -12,4 +12,5 @@ ^pkgdown$ ^index\.Rmd$ ^index\.md$ -^index\.html$ \ No newline at end of file +^index\.html$ +^CRAN-SUBMISSION$ diff --git a/.gitignore b/.gitignore index 9610e8d..8483e7b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ index.html /TAGS doc Meta +docs diff --git a/.gitmodules b/.gitmodules index b19d1be..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "website"] - path = docs - url = git@github.com:desctable/desctable.github.io diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION new file mode 100644 index 0000000..384ed92 --- /dev/null +++ b/CRAN-SUBMISSION @@ -0,0 +1,3 @@ +Version: 0.3.0 +Date: 2022-03-24 11:45:24 UTC +SHA: 5c87537288e9fafe070a1767bcc5215cc6d3c3c3 diff --git a/DESCRIPTION b/DESCRIPTION index fea163b..e26e067 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -6,16 +6,14 @@ Authors@R: c(person("Maxime", "Wack", email = "maximewack@free.fr", role = c("au person("Yihui", "Xie", email = "xieyihui@gmail.com", role = c("ctb"))) Description: Easily create descriptive and comparative tables. It makes use and integrates directly with the tidyverse family of packages, and pipes. - Tables are produced as data frames/lists of data frames for easy manipulation after creation, - and ready to be saved as csv, or piped to DT::datatable() or pander::pander() to integrate into reports. + Tables are produced as (nested) dataframes for easy manipulation. Depends: R (>= 3.2.3), pander License: GPL-3 Encoding: UTF-8 -LazyData: true URL: https://desctable.github.io -BugReports: https://github.com/maximewack/desctable/issues +BugReports: https://github.com/desctable/desctable/issues Imports: dplyr, DT, diff --git a/R/output.R b/R/output.R index fc5eecc..9d8d8a2 100644 --- a/R/output.R +++ b/R/output.R @@ -8,8 +8,8 @@ ##' } ##' ##' All numerical values will be rounded to the digits argument. -##' If statistical tests are presents, p values below 1E-digits will be replaced with "≤ 1E-digits" -##' (eg. "≤ 0.01" for values below 0.01 when digits = 2) +##' If statistical tests are presents, p values below 1E-digits will be replaced with "< 1E-digits" +##' (eg. "< 0.01" for values below 0.01 when digits = 2) ##' ##' @title desc_output ##' @param desctable The desctable to output @@ -65,7 +65,7 @@ output_df_grouped <- function(desctable, digits, ...) { tests$p[tests$p < 10^-digits] <- 10^-digits prettyNum(tests$p, digits = digits) %>% gsub(pattern = "^NA$", replacement = "") %>% - gsub(pattern = "^(0.0*1)$", replacement = "\u2264 \\1") -> tests$p + gsub(pattern = "^(0.0*1)$", replacement = "< \\1") -> tests$p table <- cbind(table, tests) } @@ -117,7 +117,7 @@ output_pander_grouped <- function(desctable, digits, ...) { tests$p[tests$p < 10^-digits] <- 10^-digits prettyNum(tests$p, digits = digits) %>% gsub(pattern = "^NA$", replacement = "") %>% - gsub(pattern = "^(0.0*1)$", replacement = "\u2264 \\1") -> tests$p + gsub(pattern = "^(0.0*1)$", replacement = "< \\1") -> tests$p table <- cbind(table, tests) } @@ -182,7 +182,7 @@ output_DT_grouped <- function(desctable, digits, ...) { tests$p[tests$p < 10^-digits] <- 10^-digits prettyNum(tests$p, digits = digits) %>% gsub(pattern = "^NA$", replacement = "") %>% - gsub(pattern = "^(0.0*1)$", replacement = "\u2264 \\1") -> tests$p + gsub(pattern = "^(0.0*1)$", replacement = "< \\1") -> tests$p table <- cbind(table, tests) } diff --git a/README.Rmd b/README.Rmd index e7b9dc8..c0a12b1 100644 --- a/README.Rmd +++ b/README.Rmd @@ -7,7 +7,10 @@ output: github_document knitr::opts_chunk$set(message = F, warning = F) ``` -[![Travis-CI Build Status](https://travis-ci.org/desctable/desctable.svg?branch=master)](https://travis-ci.org/desctable/desctable) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/desctable)](https://cran.r-project.org/package=desctable) [![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/desctable)](https://www.r-pkg.org:443/pkg/desctable) +[![Travis-CI Build Status](https://travis-ci.org/desctable/desctable.svg?branch=master)](https://travis-ci.org/desctable/desctable) +[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/desctable)](https://cran.r-project.org/package=desctable) +[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/desctable)](https://www.r-pkg.org:443/pkg/desctable) +[![CRAN RStudio mirror total downloads](http://cranlogs.r-pkg.org/badges/grand-total/desctable)](https://www.r-pkg.org:443/pkg/desctable) **Warning to existing users** *This version introduces a new API that should make the creation of tables more flexible. diff --git a/README.md b/README.md index 982c9c7..cf0a9f5 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,12 @@ Desctable ================ [![Travis-CI Build -Status](https://travis-ci.org/desctable/desctable.svg?branch=master)](https://travis-ci.org/desctable/desctable) +Status](https://travis-ci.org/desctable/desctable.svg?branch=master)](https://travis-ci.org/desctable/desctable) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/desctable)](https://cran.r-project.org/package=desctable) [![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/desctable)](https://www.r-pkg.org:443/pkg/desctable) +[![CRAN RStudio mirror total +downloads](http://cranlogs.r-pkg.org/badges/grand-total/desctable)](https://www.r-pkg.org:443/pkg/desctable) **Warning to existing users** *This version introduces a new API that should make the creation of diff --git a/cran-comments.md b/cran-comments.md index cc197db..44e8b4a 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,6 +1,5 @@ ## Test environments -* archlinux 64bits, R 3.4.0 -* centOS 6 64 bits, R 3.4.0 +* archlinux 64bits, R 4.1.3 * win-builder (devel and release) ## R CMD check results diff --git a/docs b/docs deleted file mode 160000 index c80233d..0000000 --- a/docs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c80233d437a49b77ca1f162ff5cb9d9a13c162e1 diff --git a/index.Rmd b/index.Rmd index 886bfab..83db340 100644 --- a/index.Rmd +++ b/index.Rmd @@ -7,7 +7,10 @@ output: github_document knitr::opts_chunk$set(message = F, warning = F) ``` -[![Travis-CI Build Status](https://travis-ci.org/desctable/desctable.svg?branch=master)](https://travis-ci.org/desctable/desctable) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/desctable)](https://cran.r-project.org/package=desctable) [![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/desctable)](https://www.r-pkg.org:443/pkg/desctable) +[![Travis-CI Build Status](https://travis-ci.org/desctable/desctable.svg?branch=master)](https://travis-ci.org/desctable/desctable) +[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/desctable)](https://cran.r-project.org/package=desctable) +[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/desctable)](https://www.r-pkg.org:443/pkg/desctable) +[![CRAN RStudio mirror total downloads](http://cranlogs.r-pkg.org/badges/grand-total/desctable)](https://www.r-pkg.org:443/pkg/desctable) **Warning to existing users** *This version introduces a new API that should make the creation of tables more flexible. diff --git a/index.md b/index.md index 1e5f608..a8eb80a 100644 --- a/index.md +++ b/index.md @@ -6,6 +6,8 @@ Status](https://travis-ci.org/desctable/desctable.svg?branch=master)](https://tr [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/desctable)](https://cran.r-project.org/package=desctable) [![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/desctable)](https://www.r-pkg.org:443/pkg/desctable) +[![CRAN RStudio mirror total +downloads](http://cranlogs.r-pkg.org/badges/grand-total/desctable)](https://www.r-pkg.org:443/pkg/desctable) **Warning to existing users** *This version introduces a new API that should make the creation of @@ -104,22 +106,22 @@ mtcars %>% desc_output("pander") ``` -|   | am = manual
(N = 13)
N | % | Median | IQR | am = automatic
(N = 19)
N | % | Median | IQR | p | test | -|:-------------|:---------------------------------|:----|:-------|:-----|:------------------------------------|:----|:-------|:-----|:-------|:------------| -| mpg | 13 | | 23 | 9.4 | 19 | | 17 | 4.2 | ≤ 0.01 | wilcox.test | -| **cyl** | 13 | | | | 19 | | | | ≤ 0.01 | fisher.test | -|     4 | 8 | 62 | | | 3 | 16 | | | | | -|     6 | 3 | 23 | | | 4 | 21 | | | | | -|     8 | 2 | 15 | | | 12 | 63 | | | | | -| disp | 13 | | 120 | 81 | 19 | | 276 | 164 | ≤ 0.01 | wilcox.test | -| hp | 13 | | 109 | 47 | 19 | | 175 | 76 | 0.046 | wilcox.test | -| drat | 13 | | 4.1 | 0.37 | 19 | | 3.1 | 0.63 | ≤ 0.01 | wilcox.test | -| wt | 13 | | 2.3 | 0.84 | 19 | | 3.5 | 0.41 | ≤ 0.01 | wilcox.test | -| qsec | 13 | | 17 | 2.1 | 19 | | 18 | 2 | 0.27 | wilcox.test | -| **vs** | 13 | | | | 19 | | | | 0.56 | chisq.test | -|     V-shaped | 6 | 46 | | | 12 | 63 | | | | | -|     straight | 7 | 54 | | | 7 | 37 | | | | | -| gear | 13 | | 4 | 1 | 19 | | 3 | 0 | ≤ 0.01 | wilcox.test | -| carb | 13 | | 2 | 3 | 19 | | 3 | 2 | 0.74 | wilcox.test | +|   | am = manual
(N = 13)
N | % | Median | IQR | am = automatic
(N = 19)
N | % | Median | IQR | p | test | +|:-------------|:---------------------------------|:----|:-------|:-----|:------------------------------------|:----|:-------|:-----|:--------|:------------| +| mpg | 13 | | 23 | 9.4 | 19 | | 17 | 4.2 | \< 0.01 | wilcox.test | +| **cyl** | 13 | | | | 19 | | | | \< 0.01 | fisher.test | +|     4 | 8 | 62 | | | 3 | 16 | | | | | +|     6 | 3 | 23 | | | 4 | 21 | | | | | +|     8 | 2 | 15 | | | 12 | 63 | | | | | +| disp | 13 | | 120 | 81 | 19 | | 276 | 164 | \< 0.01 | wilcox.test | +| hp | 13 | | 109 | 47 | 19 | | 175 | 76 | 0.046 | wilcox.test | +| drat | 13 | | 4.1 | 0.37 | 19 | | 3.1 | 0.63 | \< 0.01 | wilcox.test | +| wt | 13 | | 2.3 | 0.84 | 19 | | 3.5 | 0.41 | \< 0.01 | wilcox.test | +| qsec | 13 | | 17 | 2.1 | 19 | | 18 | 2 | 0.27 | wilcox.test | +| **vs** | 13 | | | | 19 | | | | 0.56 | chisq.test | +|     V-shaped | 6 | 46 | | | 12 | 63 | | | | | +|     straight | 7 | 54 | | | 7 | 37 | | | | | +| gear | 13 | | 4 | 1 | 19 | | 3 | 0 | \< 0.01 | wilcox.test | +| carb | 13 | | 2 | 3 | 19 | | 3 | 2 | 0.74 | wilcox.test | Read more in the [vignette](articles/desctable.html) ! diff --git a/man/desc_output.Rd b/man/desc_output.Rd index 30daa18..d6aabb3 100644 --- a/man/desc_output.Rd +++ b/man/desc_output.Rd @@ -30,8 +30,8 @@ Currently available formats are\itemize{ } All numerical values will be rounded to the digits argument. -If statistical tests are presents, p values below 1E-digits will be replaced with "≤ 1E-digits" -(eg. "≤ 0.01" for values below 0.01 when digits = 2) +If statistical tests are presents, p values below 1E-digits will be replaced with "< 1E-digits" +(eg. "< 0.01" for values below 0.01 when digits = 2) } \seealso{ \code{\link[DT]{datatable}}