From e36ab94e1dc14a4f2495f5aaa3bb5295ce292844 Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Thu, 14 Dec 2023 07:17:14 -0800 Subject: [PATCH] CRAN release (#36) * Catch doc NOTES caught by WinBuilder * typo * Throttle to single thread in tests * 0.1.0 * CRAN comments and submission * Also control magick nthreads - OpenMP everywhere... * roxygen2 ver * Quote package names * typo * tweak * Resubmit --- .Rbuildignore | 2 ++ CRAN-SUBMISSION | 3 +++ DESCRIPTION | 22 ++++++++++++---------- NEWS.md | 4 +++- R/iplot_data.R | 2 +- README.Rmd | 11 +++++++++-- README.md | 12 ++++++++++-- cran-comments.md | 17 +++++++++++++++++ inst/tinytest/test_nthreads.R | 24 ++++++++++++++++++++++++ man/iplot_data.Rd | 2 +- tests/tinytest.R | 26 ++++++++++++++++++++++++++ 11 files changed, 108 insertions(+), 17 deletions(-) create mode 100644 CRAN-SUBMISSION create mode 100644 cran-comments.md create mode 100644 inst/tinytest/test_nthreads.R diff --git a/.Rbuildignore b/.Rbuildignore index 86d327c..cf86ec3 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -9,3 +9,5 @@ ^\.github$ ^TESTING$ ^.vscode$ +^cran-comments.md +^CRAN-SUBMISSION$ diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION new file mode 100644 index 0000000..18cc895 --- /dev/null +++ b/CRAN-SUBMISSION @@ -0,0 +1,3 @@ +Version: 0.1.0 +Date: 2023-12-13 22:31:45 UTC +SHA: e497f7677d32404a1aed99860c8e30244ad8038b diff --git a/DESCRIPTION b/DESCRIPTION index c727bc2..c174edc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,7 @@ Package: ggfixest -Title: Dedicated ggplot2 methods for fixest objects -Version: 0.0.3.9001 +Title: Dedicated 'ggplot2' Methods for 'fixest' Objects +Version: 0.1.0 +Date: 2023-12-12 Authors@R: c(person(given = "Grant", family = "McDermott", @@ -12,16 +13,16 @@ Authors@R: role = "ctb", email = "laurent.berge@u-bordeaux.fr") ) -Description: Provides ggplot2 equivalents of fixest::coefplot and fixest::iplot, - for producing nice coefficient plots and interactions plots. Enables some +Description: Provides 'ggplot2' equivalents of fixest::coefplot() and fixest::iplot(), + for producing nice coefficient plots and interaction plots. Enables some additional functionality and convenience features, including grouped - multi-fixest object faceting and programatic updating of existing plots + multi-'fixest' object faceting and programmatic updates to existing plots (e.g., themes and aesthetics). License: GPL-3 Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3.9000 +RoxygenNote: 7.2.3 URL: http://grantmcdermott.com/ggfixest/ BugReports: https://github.com/grantmcdermott/ggfixest/issues Depends: @@ -31,16 +32,17 @@ Imports: dreamerr, ggh4x, scales, - utils, marginaleffects (>= 0.10.0), - stats + stats, + utils Suggests: knitr, - remotes, rmarkdown, tinytest (>= 1.4.1), tinysnapshot (>= 0.0.3), + magick, rsvg, svglite, - fontquiver + fontquiver, + data.table VignetteBuilder: knitr diff --git a/NEWS.md b/NEWS.md index 23f211e..1f9bf31 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,6 @@ -# ggfixest 0.0.3.9001 (development version) +# ggfixest 0.1.0 + +First CRAN release! ## New features diff --git a/R/iplot_data.R b/R/iplot_data.R index 02e806a..6c67a68 100644 --- a/R/iplot_data.R +++ b/R/iplot_data.R @@ -1,4 +1,4 @@ -#' @title Internal function for grabbing and preparing iplot data +#' @title Internal function for grabbing and preparing iplot data. #' #' @md #' @description Grabs the underlying data used to construct `fixest::iplot`, diff --git a/README.Rmd b/README.Rmd index f447ef7..e6af25d 100644 --- a/README.Rmd +++ b/README.Rmd @@ -17,6 +17,7 @@ knitr::opts_chunk$set( # ggfixest +[![CRAN status](https://www.r-pkg.org/badges/version/ggfixest)](https://CRAN.R-project.org/package=ggfixest) [![R-universe status badge](https://grantmcdermott.r-universe.dev/badges/ggfixest)](https://grantmcdermott.r-universe.dev) [![R-CMD-check](https://github.com/grantmcdermott/ggfixest/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/grantmcdermott/ggfixest/actions/workflows/R-CMD-check.yaml) [![Docs](https://img.shields.io/badge/docs-homepage-blue.svg)](https://grantmcdermott.com/ggfixest/index.html) @@ -35,7 +36,13 @@ plots---with minimal effort and scope for further customization. ## Installation -The package is not yet on CRAN, but can be installed from R-universe: +The stable version of **ggfixest** is available on CRAN. + +``` r +install.packages("ggfixest") +``` + +Or, you can grab the latest development version from R-universe. ``` r install.packages("ggfixest", repos = "https://grantmcdermott.r-universe.dev") @@ -79,7 +86,7 @@ ggcoefplot(est) ## this package The above plot call and output should look very familiar to regular **fixest** users. Like its base equivalent, `ggcoefplot` can be heavily customized and contains various shortcuts for common operations. For example, we can use regex -the control the coefficient grouping logic. +to control the coefficient grouping logic. ```{r coefplot2, message=FALSE} ggcoefplot(est, group = list(Sepal = "^^Sepal.", Species = "^^Species")) diff --git a/README.md b/README.md index ada1425..ba393b4 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ +[![CRAN +status](https://www.r-pkg.org/badges/version/ggfixest)](https://CRAN.R-project.org/package=ggfixest) [![R-universe status badge](https://grantmcdermott.r-universe.dev/badges/ggfixest)](https://grantmcdermott.r-universe.dev) [![R-CMD-check](https://github.com/grantmcdermott/ggfixest/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/grantmcdermott/ggfixest/actions/workflows/R-CMD-check.yaml) @@ -25,7 +27,13 @@ minimal effort and scope for further customization. ## Installation -The package is not yet on CRAN, but can be installed from R-universe: +The stable version of **ggfixest** is available on CRAN. + +``` r +install.packages("ggfixest") +``` + +Or, you can grab the latest development version from R-universe. ``` r install.packages("ggfixest", repos = "https://grantmcdermott.r-universe.dev") @@ -69,7 +77,7 @@ ggcoefplot(est) ## this package The above plot call and output should look very familiar to regular **fixest** users. Like its base equivalent, `ggcoefplot` can be heavily customized and contains various shortcuts for common operations. For -example, we can use regex the control the coefficient grouping logic. +example, we can use regex to control the coefficient grouping logic. ``` r ggcoefplot(est, group = list(Sepal = "^^Sepal.", Species = "^^Species")) diff --git a/cran-comments.md b/cran-comments.md new file mode 100644 index 0000000..e331448 --- /dev/null +++ b/cran-comments.md @@ -0,0 +1,17 @@ +## Overview + +`ggfixest` 0.1.0 is a new CRAN submission. + +- I have addressed the package quoting issue. +- The CPU time vs. elapsed time issue should now be resolved in the test suite. +(Single threading is explicitly imposed for data.table, fixest, and magick.) + +## Test environments + +* Local: Arch Linux +* GitHub Actions (ubuntu-22.04): oldrel-1, release, devel +* Win Builder + +## R CMD check results + +0 errors | 0 warnings | 0 notes diff --git a/inst/tinytest/test_nthreads.R b/inst/tinytest/test_nthreads.R new file mode 100644 index 0000000..84ec4ae --- /dev/null +++ b/inst/tinytest/test_nthreads.R @@ -0,0 +1,24 @@ +library(tinytest) + +exit_if_not(any(grepl("_R_CHECK", names(Sys.getenv()), fixed = TRUE))) + +# fixest +if ( requireNamespace("fixest", quietly=TRUE) ){ + library(fixest) + nfx = getFixest_nthreads() + expect_equal(nfx, 1, info = "Check fixest threads") +} + +# data.table +if (requireNamespace("data.table", quietly = TRUE)) { + library(data.table) + nDT = getDTthreads() + expect_equal(nDT, 1, info = "Check data.table threads") +} + +# magick +if (requireNamespace("magick", quietly = TRUE)) { + library(magick) + nmg = magick:::magick_threads(1) + expect_equal(nmg, 1, info = "Check magick threads") +} diff --git a/man/iplot_data.Rd b/man/iplot_data.Rd index 74f67db..a933bd1 100644 --- a/man/iplot_data.Rd +++ b/man/iplot_data.Rd @@ -3,7 +3,7 @@ \name{iplot_data} \alias{iplot_data} \alias{coefplot_data} -\title{Internal function for grabbing and preparing iplot data} +\title{Internal function for grabbing and preparing iplot data.} \usage{ iplot_data( object, diff --git a/tests/tinytest.R b/tests/tinytest.R index 608a2be..da15b41 100644 --- a/tests/tinytest.R +++ b/tests/tinytest.R @@ -1,5 +1,31 @@ +## Throttle CPU threads if R CMD check (for CRAN) + +if (any(grepl("_R_CHECK", names(Sys.getenv()), fixed = TRUE))) { + # fixest + if (requireNamespace("fixest", quietly = TRUE)) { + library(fixest) + setFixest_nthreads(1) + } + + # data.table + if (requireNamespace("data.table", quietly = TRUE)) { + library(data.table) + setDTthreads(1) + } + + # magick + if (requireNamespace("magick", quietly = TRUE)) { + library(magick) + magick:::magick_threads(1) + } +} + + +# Run tinytest suite if ( requireNamespace("tinytest", quietly=TRUE) ){ + tinytest::test_package("ggfixest") + }