From ee012f6451185729de82053cb9e831c9a8cf7459 Mon Sep 17 00:00:00 2001 From: Dan Chaltiel Date: Mon, 10 Apr 2023 11:31:58 +0200 Subject: [PATCH] Fixes for CRAN checks. --- CRAN-SUBMISSION | 6 +++--- DESCRIPTION | 2 +- NEWS.md | 4 ++++ R/officer.R | 26 +++++++++++++------------- README.Rmd | 2 +- README.md | 14 +++++++------- codemeta.json | 17 +++++++++++++++-- cran-comments.md | 2 +- man/body_add_gg2.Rd | 26 +++++++++++++------------- vignettes/crosstable-install.Rmd | 8 ++++---- vignettes/crosstable-report.Rmd | 2 +- 11 files changed, 63 insertions(+), 46 deletions(-) diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION index 44532f6f..c5c25edf 100644 --- a/CRAN-SUBMISSION +++ b/CRAN-SUBMISSION @@ -1,3 +1,3 @@ -Version: 0.6.0 -Date: 2023-03-26 18:53:52 UTC -SHA: 1eb54c938cf2dbe9fb2cdcde74bea728f5c693a7 +Version: 0.6.1 +Date: 2023-04-03 20:07:58 UTC +SHA: 8fc33289ec5f70e3c6b80c21233a1eeaa25b827c diff --git a/DESCRIPTION b/DESCRIPTION index 6e7b17e9..65ca1e61 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: crosstable Title: Crosstables for Descriptive Analyses -Version: 0.6.0.9001 +Version: 0.6.1 Authors@R: c(person(given = "Dan", family = "Chaltiel", diff --git a/NEWS.md b/NEWS.md index 685fc24a..280a6606 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ Crosstables for descriptive analyses. See documentation at and browse code at . +# crosstable 0.6.1 2023-04-03 + +Fixes for CRAN checks. + # crosstable 0.6.0 2023-03-26 #### New features diff --git a/R/officer.R b/R/officer.R index c1f534a4..a24fba53 100644 --- a/R/officer.R +++ b/R/officer.R @@ -582,19 +582,19 @@ body_add_img2 = function(doc, src, width, height, #' @importFrom checkmate assert_class #' @importFrom rlang check_installed #' @examples -#' if(require("ggplot2") && capabilities(what = "png")){ -#' library(officer) -#' p = ggplot(data = iris ) + -#' geom_point(mapping = aes(Sepal.Length, Petal.Length)) -#' -#' options(crosstable_units="cm") -#' options(crosstable_style_image="centered") -#' doc = read_docx() %>% -#' body_add_normal("Text before") %>% -#' body_add_gg2(p, w=14, h=10, scale=1.5) %>% #or units="cm" instead of using options -#' body_add_normal("Text after") -#' #write_and_open(doc) -#' } +#' library(officer) +#' library(ggplot2) +#' p = ggplot(data = iris ) + +#' geom_point(mapping = aes(Sepal.Length, Petal.Length)) +#' crosstable_options( +#' units="cm", +#' style_image="centered" +#' ) +#' doc = read_docx() %>% +#' body_add_normal("Text before") %>% +#' body_add_gg2(p, w=14, h=10, scale=1.5) %>% #or units="cm" instead of using options +#' body_add_normal("Text after") +#' write_and_open(doc) body_add_gg2 = function(doc, value, width = 6, height = 5, units = getOption("crosstable_units", "in"), style = getOption("crosstable_style_image", doc$default_styles$paragraph), diff --git a/README.Rmd b/README.Rmd index f7828667..c372526d 100644 --- a/README.Rmd +++ b/README.Rmd @@ -139,7 +139,7 @@ You can find the whole documentation on the [dedicated website](https://danchalt + `vignette("crosstable")` for a first step-by-step guide on how to use `crosstable` ([link](https://danchaltiel.github.io/crosstable/articles/crosstable.html)) + `vignette("crosstable-report")` for more on creating MS Word reports using either `{officer}` or `Rmarkdown` ([link](https://danchaltiel.github.io/crosstable/articles/crosstable-report.html)) + `vignette("pertent_pattern")` for more on how to use `percent_pattern` ([link](https://danchaltiel.github.io/crosstable/articles/crosstable-selection.html)) -+ `vignette("crosstable-selection")` for more on variable selection ([link](https://danchaltiel.github.io/crosstable/articles/crosstable-selection.html)), although you would better read https://tidyselect.r-lib.org/articles/syntax.html. ++ `vignette("crosstable-selection")` for more on variable selection ([link](https://danchaltiel.github.io/crosstable/articles/crosstable-selection.html)), although you should better read https://tidyselect.r-lib.org/articles/syntax.html. There are lots of other features you can learn about there, for instance (non-exhaustive list): diff --git a/README.md b/README.md index 4dd7701f..7d5a9f14 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ install.packages("crosstable") devtools::install_github("DanChaltiel/crosstable", build_vignettes=TRUE) # Install specific commit or tagged version (for reproducibility purpose) -devtools::install_github("DanChaltiel/crosstable@51689eb", build_vignettes=TRUE) +devtools::install_github("DanChaltiel/crosstable@8fc3328", build_vignettes=TRUE) devtools::install_github("DanChaltiel/crosstable@v0.6.0", build_vignettes=TRUE) ``` @@ -92,8 +92,8 @@ to learn how). Here is a more advanced example. > Dear crosstable, using the `mtcars2` dataset again, please describe -> all columns whose name starts with “cy” and those whose name ends with -> “at”, depending on the levels of both columns `am` and `vs`, without +> all columns whose name starts with "cy" and those whose name ends with +> "at", depending on the levels of both columns `am` and `vs`, without > considering labels, applying `mean()` and `quantile()` as summary > function, with `probs` 25% and 75% defined for this latter function, > and with 3 decimals for numeric variables: @@ -136,7 +136,7 @@ website](https://danchaltiel.github.io/crosstable/): ([link](https://danchaltiel.github.io/crosstable/articles/crosstable-selection.html)) - `vignette("crosstable-selection")` for more on variable selection ([link](https://danchaltiel.github.io/crosstable/articles/crosstable-selection.html)), - although you would better read + although you should better read . There are lots of other features you can learn about there, for instance @@ -144,10 +144,10 @@ There are lots of other features you can learn about there, for instance - description of correlation, dates, and survival data ([link](https://danchaltiel.github.io/crosstable/articles/crosstable.html#miscellaneous-1)) -- variable selection with functions, e.g. `is.numeric` +- variable selection with functions, e.g. `is.numeric` ([link](https://danchaltiel.github.io/crosstable/articles/crosstable-selection.html#select-with-predicate-functions)) - formula interface, allowing to describe more mutated columns, - e.g. `sqrt(mpg)` or `Surv(time, event)` + e.g. `sqrt(mpg)` or `Surv(time, event)` ([link](https://danchaltiel.github.io/crosstable/articles/crosstable-selection.html#select-with-a-formula)) - automatic computation of statistical tests ([link](https://danchaltiel.github.io/crosstable/articles/crosstable.html#tests)) @@ -161,7 +161,7 @@ There are lots of other features you can learn about there, for instance If you have a question about how to use `crosstable`, please ask on [StackOverflow](https://stackoverflow.com/) with the tag `crosstable`. You can `@DanChaltiel` in a comment if you are struggling to get -answers. Don’t forget to add a minimal **repr**oducible **ex**ample to +answers. Don't forget to add a minimal **repr**oducible **ex**ample to your question, ideally using the [reprex](https://reprex.tidyverse.org/) package. diff --git a/codemeta.json b/codemeta.json index 35123dcc..da090f29 100644 --- a/codemeta.json +++ b/codemeta.json @@ -8,7 +8,7 @@ "codeRepository": "https://github.com/DanChaltiel/crosstable/", "issueTracker": "https://github.com/DanChaltiel/crosstable/issues/", "license": "https://spdx.org/licenses/GPL-3.0", - "version": "0.6.0", + "version": "0.6.1", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", @@ -256,6 +256,18 @@ }, "sameAs": "https://CRAN.R-project.org/package=systemfonts" }, + { + "@type": "SoftwareApplication", + "identifier": "tidyselect", + "name": "tidyselect", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=tidyselect" + }, { "@type": "SoftwareApplication", "identifier": "testthat", @@ -355,6 +367,7 @@ "@type": "SoftwareApplication", "identifier": "forcats", "name": "forcats", + "version": ">= 1.0.0", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -473,7 +486,7 @@ }, "SystemRequirements": null }, - "fileSize": "1502.912KB", + "fileSize": "1504.452KB", "releaseNotes": "https://github.com/DanChaltiel/crosstable/blob/master/NEWS.md", "readme": "https://github.com/DanChaltiel/crosstable/blob/main/README.md", "contIntegration": ["https://app.codecov.io/gh/DanChaltiel/crosstable?branch=main", "https://github.com/DanChaltiel/crosstable/actions"], diff --git a/cran-comments.md b/cran-comments.md index 38c3b83a..43c6615b 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -20,4 +20,4 @@ Thank you very much. ## Comment -* No comment +* I removed one test on Mac as it seems to be an encoding problem diff --git a/man/body_add_gg2.Rd b/man/body_add_gg2.Rd index a597d20b..39a93535 100644 --- a/man/body_add_gg2.Rd +++ b/man/body_add_gg2.Rd @@ -37,19 +37,19 @@ The docx object \code{doc} Alternative to \code{\link[officer:body_add_gg]{officer::body_add_gg()}} which uses \code{ggplot} syntax } \examples{ -if(require("ggplot2") && capabilities(what = "png")){ - library(officer) - p = ggplot(data = iris ) + - geom_point(mapping = aes(Sepal.Length, Petal.Length)) - - options(crosstable_units="cm") - options(crosstable_style_image="centered") - doc = read_docx() \%>\% - body_add_normal("Text before") \%>\% - body_add_gg2(p, w=14, h=10, scale=1.5) \%>\% #or units="cm" instead of using options - body_add_normal("Text after") - #write_and_open(doc) -} +library(officer) +library(ggplot2) +p = ggplot(data = iris ) + + geom_point(mapping = aes(Sepal.Length, Petal.Length)) +crosstable_options( + units="cm", + style_image="centered" +) +doc = read_docx() \%>\% + body_add_normal("Text before") \%>\% + body_add_gg2(p, w=14, h=10, scale=1.5) \%>\% #or units="cm" instead of using options + body_add_normal("Text after") +write_and_open(doc) } \author{ Dan Chaltiel diff --git a/vignettes/crosstable-install.Rmd b/vignettes/crosstable-install.Rmd index 478669ed..571cc15c 100644 --- a/vignettes/crosstable-install.Rmd +++ b/vignettes/crosstable-install.Rmd @@ -85,8 +85,8 @@ Try first with "no", and then with "yes" if it fails. This error can happen on Mac. I have no clue on how to correct it. If you experience it, please create an [Issue](https://github.com/DanChaltiel/crosstable/issues) with the actual error message and the result of `sessionInfo()`. -> ERROR: configuration failed for package ‘systemfonts’ -> * removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/systemfonts’ -> * restoring previous ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/systemfonts’ +> ERROR: configuration failed for package 'systemfonts' +> * removing '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/systemfonts' +> * restoring previous '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/systemfonts' > Error: Failed to install 'crosstable' from GitHub: -> (converted from warning) installation of package ‘systemfonts’ had non-zero exit status +> (converted from warning) installation of package 'systemfonts' had non-zero exit status diff --git a/vignettes/crosstable-report.Rmd b/vignettes/crosstable-report.Rmd index 0144043c..957b50f5 100644 --- a/vignettes/crosstable-report.Rmd +++ b/vignettes/crosstable-report.Rmd @@ -186,7 +186,7 @@ In this case, you have to manually update the references inside MS Word: select ## Create reports with `Rmarkdown` - + Knitting (`knitr::knit()` or via **RStudio**) this `Rmd` code also creates a MS-Word file. Here, you can use the power of `bookdown` to generate the automatic numbering of the tables.