diff --git a/.Rbuildignore b/.Rbuildignore index 4772182..0fb6768 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -7,3 +7,5 @@ inst/design/ archive ^\.github$ ^man-roxygen$ +CNAME +temp.R diff --git a/DESCRIPTION b/DESCRIPTION index fe1c89a..ee2ccf3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: powerly Title: Sample Size Analysis for Psychological Networks and More -Version: 1.7.3 +Version: 1.7.4 Authors@R: person(given = "Mihai", family = "Constantin", @@ -18,7 +18,7 @@ Description: An implementation of the sample size computation method for network sample size range. The final step employs stratified bootstrapping to quantify the uncertainty around the fitted curve. License: MIT + file LICENSE -URL: https://github.com/mihaiconstantin/powerly +URL: https://powerly.dev BugReports: https://github.com/mihaiconstantin/powerly/issues Imports: R6, diff --git a/NEWS.md b/NEWS.md index 340036f..a97fc8f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,301 +1,228 @@ -# `powerly` (development) - -## Bug fixes - -* Add missing import for `mvnorm` package. - -# `powerly` `1.7.3` - -## Improvements - -* Update badges order in `README.md` and removed open issues badge. - -* Fix typos in `NEWS` file. - -# `powerly` `1.7.2` - -## Improvements - -* Update GGM estimation test to check if the estimation fails when variables +# Changelog +All notable changes to this project will be documented in this file. The format +is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this +project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.7.4] - 2022-04-30 +### Added +- Add `duration` field to `StepTwo` class to record the execution time for the + spline fitting procedure +- Add `CNAME` for apex domain `https://powerly.dev` served via GitHub Pages. + +### Fixed +- Fix missing import for `mvnorm` package (#11). Closes #5. +- Fix missing number of `cores` in `Backend` when more cores than available were + requested (#12). Closes #2. +- Fix legend overlapping spline confidence bands for `StepThree` plot (#13). + Closes #3. +- Fix recording and reporting of `Method` and step classes execution time (#15). + The duration is now recorded in seconds. Closes #9. + +### Removed +- Remove `dev` branch from all `GitHub` workflows (#14). Switched to the + `GitHub` flow. Closes #4. + +## [1.7.3] +#### Changed +- Update badges order in `README.md` and removed open issues badge. + +#### Fixed +- Fix typos in `NEWS` file. + +## [1.7.2] +### Added +- Add GitHub badges with latest release version and number of open issues. + +### Changed +- Update GGM estimation test to check if the estimation fails when variables with zero standard deviation are present in the generated data. - -* Update GGM estimation to fail when the generated data contains at least one +- Update GGM estimation to fail when the generated data contains at least one variable that has a standard deviation equal to zero (i.e., as a result of generating data with a sample size value that is too low). -* Add GitHub badges with latest release version and number of open issues. - -## Bug fixes - -* Add tolerance (i.e., `0.0000001`) for test checking whether the spline +### Fixed +- Add tolerance (i.e., `0.0000001`) for test checking whether the spline coefficients are estimated correctly. - -* Fix test for the updating of the bounds of a `Range` instance to run only when +- Fix test for the updating of the bounds of a `Range` instance to run only when the the 2.5th and 97.5th selected sample sizes are different quantities. - -* Fix bug in GGM data generating test where the number of nodes to generate data +- Fix bug in GGM data generating test where the number of nodes to generate data for were incorrectly sampled. -# `powerly` `1.7.1` - -## Improvements - -* Update moved URL https://codecov.io/gh/mihaiconstantin/powerly to +## [1.7.1] +### Changed +- Update moved URL https://codecov.io/gh/mihaiconstantin/powerly to https://app.codecov.io/gh/mihaiconstantin/powerly based on comments of CRAN maintainer Uwe Ligges. -# `powerly` `1.7.0` - -## Features - -* Add `summary` S3 method support for `Validation` class objects. - -## Improvements - -* Add new `R` version to the CI pipeline for the `R CMD check` job. - -* Update `R CMD check` workflow to use `check` action from `r-lib/actions`. +## [1.7.0] +### Added +- Add `summary` S3 method support for `Validation` class objects. -* Add explicit `.data` and `.env` pronoun calls (i.e., from the `rlang` package) +### Changed +- Add new `R` version to the CI pipeline for the `R CMD check` job. +- Update `R CMD check` workflow to use `check` action from `r-lib/actions`. +- Add explicit `.data` and `.env` pronoun calls (i.e., from the `rlang` package) to variables used inside data-masking function (e.g., `ggplot2::aes()`) to avoid `CRAN` notes regarding missing bindings for global variables. See this question for more information: https://stackoverflow.com/q/9439256/5252007. - -* Update plot functions to respect the signature of the S3 plot generic. - -* Improve documentation and positioning of figures in the help pages. - -* Create `roxygen2` templates for documenting the public API and S3 methods. - -* Extract `plot()` methods from `R6` classes into standalone S3 methods. - -* Update package start-up logo with message to welcome and encourage users to +- Update plot functions to respect the signature of the S3 plot generic. +- Improve documentation and positioning of figures in the help pages. +- Create `roxygen2` templates for documenting the public API and S3 methods. +- Extract `plot()` methods from `R6` classes into standalone S3 methods. +- Update package start-up logo with message to welcome and encourage users to submit ideas for improving the package. +- Extend CI workflow to include branch `dev`. -* Extend CI workflow to include branch `dev`. - -* Fix preprint URL in package documentation. - -* Fix heading typo in news file. - -## Bug fixes - -* Fix backend test where the cluster would contain an unexpected `.Random.seed`. +### Fixed +- Fix backend test where the cluster would contain an unexpected `.Random.seed`. The `.Random.seed` is caused by loading the `bootnet` package which in turn loads the `snow` package. The `snow` package uses the `RNG` within the `.onLoad()` function to draw from the uniform distribution and set a port number. The result of this operation is a `.Random.seed` in the `.GlobalEnv`. For more information see: https://stackoverflow.com/q/69866215/5252007 and https://github.com/SachaEpskamp/bootnet/issues/82. +- Fix preprint URL in package documentation. +- Fix heading typo in news file. -# `powerly` `1.6.1` - -## Improvements - -* Update line exclusions for `covr::codecov()`. - -# `powerly` `1.6.0` - -## Improvements - -* Add new `Validation` class plot to `README.md` file. +## [1.6.1] +### Changed +- Update line exclusions for `covr::codecov()`. -* Update `GgmModel` tests to vary various model estimation and data generation +## [1.6.0] +### Changed +- Add new `Validation` class plot to `README.md` file. +- Update `GgmModel` tests to vary various model estimation and data generation parameters. - -* Update `testthat::expect_equal` to test with a tolerance of `1e-6` for `Basis` +- Update `testthat::expect_equal` to test with a tolerance of `1e-6` for `Basis` and `Solver`. - -* Replace own `GgmModel` estimation with `qgraph::EBICglasso()`. - -* Add ECDF plot to `Validation` class. - -* Import external functions to `NAMESPACE` via `Roxygen2`. - -* Add more cool badges to `README.md` (e.g., CRAN version and check status). - -* Fix missing missing period in package description in `DESCRIPTION` file. - -## Bug fixes - -* Fix issue where `GGM` estimation test would fail due to a precision level set +- Replace own `GgmModel` estimation with `qgraph::EBICglasso()`. +- Add ECDF plot to `Validation` class. +- Import external functions to `NAMESPACE` via `Roxygen2`. +- Add more cool badges to `README.md` (e.g., CRAN version and check status). +- Fix missing missing period in package description in `DESCRIPTION` file. + +### Fixed +- Fix issue where `GGM` estimation test would fail due to a precision level set too high. -# `powerly` `1.5.2` - -## Bug fixes - -* Update `Description` field in `DESCRIPTION` file to follow CRAN guidelines. - -# `powerly` `1.5.1` +## [1.5.2] +### Fixed +- Update `Description` field in `DESCRIPTION` file to follow CRAN guidelines. -## Bug fixes - -* Update preprint link in `powerly()` documentation to use the `\doi{}` syntax +## [1.5.1] +### Fixed +- Update preprint link in `powerly()` documentation to use the `\doi{}` syntax as indicated by CRAN member Uwe Ligges. - -* Update `DESCRIPTION` to start with capital letter as indicated by CRAN member +- Update `DESCRIPTION` to start with capital letter as indicated by CRAN member Uwe Ligges. +- Fix typo in `DESCRIPTION`. -* Fix typo in `DESCRIPTION`. - -# `powerly` `1.5.0` - -## Features - -* Add preliminary `summary()` support for `Method` and `Validation` objects. - -* Update citation and references to the preprint available at +## [1.5.0] +### Added +- Add preliminary `summary()` support for `Method` and `Validation` objects. +- Update citation and references to the preprint available at [psyarxiv.com/j5v7u](https://psyarxiv.com/j5v7u). - -* Add `ggplot` plots and saving support for `StepOne`, `StepTwo`, `StepThree` +- Add `ggplot` plots and saving support for `StepOne`, `StepTwo`, `StepThree` and `Validation` objects. -## Improvements - -* Migrate from `R` base plots to `ggplot2` and `patchwork`. - -* Add more detailed `Description` in `DESCRIPTION` file as per comment by CRAN +### Changed +- Migrate from `R` base plots to `ggplot2` and `patchwork`. +- Add more detailed `Description` in `DESCRIPTION` file as per comment by CRAN member Julia Haider. -## Bug fixes - -* Fix seed in `StepOne` unit test. - -* Fix superfluous test fail for `GGM` model estimation. Restricted the unit test +### Fixed +- Fix seed in `StepOne` unit test. +- Fix superfluous test fail for `GGM` model estimation. Restricted the unit test to compare the estimated edge weights up to 7 digits precision. -# `powerly` `1.4.0` - -## Features - -* Add code coverage workflow based on action provided by +## [1.4.0] +### Added +- Add code coverage workflow based on action provided by `usethis::use_github_action("test-coverage")` and badge to `README.md`. -# `powerly` `1.3.0` - -## Bug fixes - -* Fix cluster creation bug in `Backend` when the machine had only 1 or 2 cores. +## [1.3.0] +### Fixed +- Fix cluster creation bug in `Backend` when the machine had only 1 or 2 cores. The previous version would result in an error when the machine contained only 1 or 2 cores. Now, when the machine has only 1 core, the cluster creation will fail, with a message that not enough cores are available. When the machine has 2 cores, all 2 cores are used. In all other cases, the number of cores used is given by the number of cores on the machine minus one. -## Improvements - -* Add names and comments to workflow file `R-CMD-check.yaml`. - -* Update `README.md` and package startup logo to only show major version. - -* Update existing tests and added new ones. - -* Add type check for `method` argument of `validate()` to ensure that only +### Changed +- Add names and comments to workflow file `R-CMD-check.yaml`. +- Update `README.md` and package startup logo to only show major version. +- Update existing tests and added new ones. +- Add type check for `method` argument of `validate()` to ensure that only instances of `Method` class (i.e., produced by `powerly()` are passed). - -* Add `Backend` stopping to `on.exit()` in `powerly()` to ensure the cluster is +- Add `Backend` stopping to `on.exit()` in `powerly()` to ensure the cluster is stopped no matter the execution status of the function. - -* Improve logic around setting and resetting the number of cores when the +- Improve logic around setting and resetting the number of cores when the cluster is created and stopped (i.e., also for adopted clusters). +- Correct version number and add changes in `NEWS.md` for `1.2.0`. -* Correct version number and add changes in `NEWS.md` for `1.2.0`. - -# `powerly` `1.2.0` - -## Features +## [1.2.0] +### Added +- Add *CI* workflow via `usethis::use_github_action_check_standard()`. -* Add *CI* workflow via `usethis::use_github_action_check_standard()`. +### Fixed +- Restrict tests to using a maximum of two cores to respect CRAN restriction. -## Bug fixes +### Changed +- Hide package logo at startup if the `R` session is not interactive. +- Add more informative changelogs to `NEWS.md` for previous releases. -* Restrict tests to using a maximum of two cores to respect CRAN restriction. - -## Improvements - -* Hide package logo at startup if the `R` session is not interactive. - -* Add more informative changelogs to `NEWS.md` for previous releases. - -# `powerly` `1.1.1` - -## Bug fixes - -* Add `.remove_missing()` to clear any `NA` values that may be present in +## [1.1.1] +### Fixed +- Add `.remove_missing()` to clear any `NA` values that may be present in `.measures` in `StepOne` class after the *Monte Carlo* procedure. -# `powerly` `1.1.1` - -## Bug fixes - -* Fix broken URLs in documentation causing build warnings. - -# `powerly` `1.1.0` - -## Features - -* Add `validate()` public *API* to validate method results. - -* Add `Validation` class to perform validation on a `Method` object. - -## Improvements - -* Add example in `README.md` for `validation()` and fixed images. - -* Decrease legend font size in `StepThree` class. - -* Rename from quantile to percentile in `StepThree` class plots. - -# `powerly` `1.0.0` - -* Add `powerly()` public *API* to run the method. - -* Add `generate_model()` public *API* to generate true models. - -* Add package documentation for public *API*. - -* Add plotting for all three method steps. - -* Add option to save last two iterations in `Method` class. - -* Add `Method` class to run the method steps iteratively. - -* Add parallel support for *Step 1* and *Step 3* of the method. - -* Add `Backend` class to manage parallel clusters. - -* Add support for multiple solvers for estimating spline coefficients. - -* Rewrite prototype using `R6` *OOP* style into first stable release. - -# `powerly` `0.2.0` - -* Remove text feedback from each method step function. - -# `powerly` `0.1.1` - -* Fix bug cased by initial candidate sample size ranges being too narrow. - -# `powerly` `0.1.0` - -## Features - -* Add preliminary support for the *Gaussian Graphical Model* via `ggm` object. - -* Add preliminary support for two statistics via `statistic.power()` and +## [1.1.1] +### Fixed +- Fix broken URLs in documentation causing build warnings. + +## [1.1.0] +### Added +- Add `validate()` public *API* to validate method results. +- Add `Validation` class to perform validation on a `Method` object. + +### Changed +- Add example in `README.md` for `validation()` and fixed images. +- Decrease legend font size in `StepThree` class. +- Rename from quantile to percentile in `StepThree` class plots. + +## [1.0.0] +### Added +- Add `powerly()` public *API* to run the method. +- Add `generate_model()` public *API* to generate true models. +- Add package documentation for public *API*. +- Add plotting for all three method steps. +- Add option to save last two iterations in `Method` class. +- Add `Method` class to run the method steps iteratively. +- Add parallel support for *Step 1* and *Step 3* of the method. +- Add `Backend` class to manage parallel clusters. +- Add support for multiple solvers for estimating spline coefficients. +- Rewrite prototype using `R6` *OOP* style into first stable release. + +## [0.2.0] +### Removed +- Remove text feedback from each method step function. + +## [0.1.1] +### Fixed +- Fix bug cased by initial candidate sample size ranges being too narrow. + +## [0.1.0] +### Added +- Add preliminary support for the *Gaussian Graphical Model* via `ggm` object. +- Add preliminary support for two statistics via `statistic.power()` and `statistic.mean()`. - -* Add `validate.recommendation()` prototype for validating a sample size +- Add `validate.recommendation()` prototype for validating a sample size recommendation. - -* Add `run.method()` prototype for running all method steps iteratively. - -* Add `run.step.1()` prototype for *Step 1* of the method. - -* Add `run.step.2()` prototype for *Step 2* of the method. - -* Add `run.step.3()` prototype for *Step 3* of the method. +- Add `run.method()` prototype for running all method steps iteratively. +- Add `run.step.1()` prototype for *Step 1* of the method. +- Add `run.step.2()` prototype for *Step 2* of the method. +- Add `run.step.3()` prototype for *Step 3* of the method. --- diff --git a/man/powerly-package.Rd b/man/powerly-package.Rd index a36b639..93e750d 100644 --- a/man/powerly-package.Rd +++ b/man/powerly-package.Rd @@ -21,7 +21,7 @@ stratified bootstrapping to quantify the uncertainty around the fitted curve. \seealso{ Useful links: \itemize{ - \item \url{https://github.com/mihaiconstantin/powerly} + \item \url{https://powerly.dev} \item Report bugs at \url{https://github.com/mihaiconstantin/powerly/issues} }