diff --git a/.github/workflows/r_cmd_check.yml b/.github/workflows/r_cmd_check.yml index 50c347e..9347896 100644 --- a/.github/workflows/r_cmd_check.yml +++ b/.github/workflows/r_cmd_check.yml @@ -21,16 +21,20 @@ jobs: fail-fast: false matrix: config: + - {os: macOS-latest, r: 'release'} - {os: windows-latest, r: 'release'} - - {os: macos-latest, r: 'release'} - - {os: ubuntu-16.04, r: '3.4', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"} - - {os: ubuntu-16.04, r: '3.5', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"} - - {os: ubuntu-16.04, r: '3.6', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"} - - {os: ubuntu-16.04, r: 'release', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"} + - {os: windows-latest, r: '3.6'} + - {os: ubuntu-16.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} + - {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} + - {os: ubuntu-16.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} + - {os: ubuntu-16.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} + - {os: ubuntu-16.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} + - {os: ubuntu-16.04, r: '3.3', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} env: R_REMOTES_NO_ERRORS_FROM_WARNINGS: true RSPM: ${{ matrix.config.rspm }} + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 @@ -45,6 +49,7 @@ jobs: run: | install.packages('remotes') saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") shell: Rscript {0} - name: Cache R packages @@ -52,17 +57,16 @@ jobs: uses: actions/cache@v1 with: path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}- + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - name: Install system dependencies if: runner.os == 'Linux' - env: - RHUB_PLATFORM: linux-x86_64-ubuntu-gcc run: | - Rscript -e "remotes::install_github('r-hub/sysreqs')" - sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))") - sudo -s eval "$sysreqs" + while read -r cmd + do + eval sudo $cmd + done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "16.04"), sep = "\n")') - name: Install dependencies run: | @@ -70,16 +74,27 @@ jobs: remotes::install_cran("rcmdcheck") shell: Rscript {0} + - name: Session info + run: | + options(width = 100) + pkgs <- installed.packages()[, "Package"] + sessioninfo::session_info(pkgs, include_base = TRUE) + shell: Rscript {0} + - name: Check env: - _R_CHECK_CRAN_INCOMING_REMOTE_: false + _R_CHECK_CRAN_INCOMING_: false run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") shell: Rscript {0} + - name: Show testthat output + if: always() + run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true + shell: bash + - name: Upload check results if: failure() - uses: actions/upload-artifact@master + uses: actions/upload-artifact@main with: name: ${{ runner.os }}-r${{ matrix.config.r }}-results path: check - diff --git a/.github/workflows/test_coverage.yml b/.github/workflows/test_coverage.yml index 7358522..8d8d58e 100644 --- a/.github/workflows/test_coverage.yml +++ b/.github/workflows/test_coverage.yml @@ -11,7 +11,9 @@ name: test-coverage jobs: test-coverage: - runs-on: ubuntu-latest + runs-on: ubuntu-16.04 + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 @@ -22,24 +24,23 @@ jobs: - name: Query dependencies run: | install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2) + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") shell: Rscript {0} - name: Cache R packages uses: actions/cache@v1 with: path: ${{ env.R_LIBS_USER }} - key: ubuntu-r-release-${{ hashFiles('depends.Rds') }} - restore-keys: ubuntu-r-release- + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - name: Install system dependencies - if: runner.os == 'Linux' - env: - RHUB_PLATFORM: linux-x86_64-ubuntu-gcc run: | - Rscript -e "remotes::install_github('rcannood/sysreqs')" - sysreqs=$(Rscript -e "cat(sysreqs:::sysreq_commands_pkgs(sysreqs:::get_cran_sysreqs(sysreqs:::get_cran_deps('covr'))))") - sudo -s eval "$sysreqs" + while read -r cmd + do + eval sudo $cmd + done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "16.04"), sep = "\n")') - name: Install dependencies run: | @@ -51,4 +52,3 @@ jobs: - name: Test coverage run: covr::codecov() shell: Rscript {0} - diff --git a/DESCRIPTION b/DESCRIPTION index f7f07af..958dc43 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: princurve -Version: 2.1.5.9001 +Version: 2.1.6 Title: Fit a Principal Curve in Arbitrary Dimension Authors@R: c( person("Trevor", "Hastie", email = "trevor@research.att.com", role = "aut"), diff --git a/NEWS.md b/NEWS.md index e1ec476..c57346e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,11 @@ +# princurve 2.1.6 (2021-01-17) + + * BUG FIX `project_to_curve()`: Return error message when `x` or `s` contain + insufficient rows. + + * BUG FIX unit tests: Switch from `svg()` to `pdf()` as support for `svg()` + might be optional. + # princurve 2.1.5 (2020-08-13) * BUG FIX `project_to_curve()`: Fix pass-by-reference bug, issue #33. Thanks diff --git a/R/package.R b/R/package.R index c3afb92..a6e1250 100644 --- a/R/package.R +++ b/R/package.R @@ -18,7 +18,7 @@ #' Hastie, T. and Stuetzle, W., #' \href{https://www.jstor.org/stable/2289936}{Principal Curves}, #' JASA, Vol. 84, No. 406 (Jun., 1989), pp. 502-516, -#' DOI: \href{https://doi.org/10.2307/2289936}{10.2307/2289936} +#' \doi{10.2307/2289936} #' (\href{https://web.stanford.edu/~hastie/Papers/principalcurves.pdf}{PDF}). #' #' See also Banfield and Raftery (JASA, 1992). diff --git a/R/principal_curve.R b/R/principal_curve.R index af5976b..e5df5e3 100644 --- a/R/principal_curve.R +++ b/R/principal_curve.R @@ -54,7 +54,7 @@ #' Hastie, T. and Stuetzle, W., #' \href{https://www.jstor.org/stable/2289936}{Principal Curves}, #' JASA, Vol. 84, No. 406 (Jun., 1989), pp. 502-516, -#' DOI: \href{https://doi.org/10.2307/2289936}{10.2307/2289936} +#' \doi{10.2307/2289936} #' (\href{https://web.stanford.edu/~hastie/Papers/principalcurves.pdf}{PDF}). #' #' @export diff --git a/README.Rmd b/README.Rmd index d1872d4..9c9c021 100644 --- a/README.Rmd +++ b/README.Rmd @@ -56,4 +56,4 @@ cat(dynutils::recent_news()) ## References -Hastie, T. and Stuetzle, W., [Principal Curves](https://www.jstor.org/stable/2289936), JASA, Vol. 84, No. 406 (Jun., 1989), pp. 502-516, DOI: [10.2307/2289936](http://doi.org/10.2307/2289936) ([PDF](https://web.stanford.edu/~hastie/Papers/principalcurves.pdf)) +Hastie, T. and Stuetzle, W., [Principal Curves](https://www.jstor.org/stable/2289936), JASA, Vol. 84, No. 406 (Jun., 1989), pp. 502-516, DOI: [10.2307/2289936](https://doi.org/10.2307/2289936) ([PDF](https://web.stanford.edu/~hastie/Papers/principalcurves.pdf)) diff --git a/README.md b/README.md index 0240ed1..3537ae8 100644 --- a/README.md +++ b/README.md @@ -52,22 +52,23 @@ list of changes. -### Recent changes in princurve 2.1.5 (2020-08-13) +### Recent changes in princurve 2.1.6 (2021-01-17) - - BUG FIX `project_to_curve()`: Fix pass-by-reference bug, issue \#33. - Thanks to @szcf-weiya for detecting and fixing this bug\! +- BUG FIX `project_to_curve()`: Return error message when `x` or `s` + contain insufficient rows. -### Recent changes in princurve 2.1.4 (2019-05-29) +- BUG FIX unit tests: Switch from `svg()` to `pdf()` as support for + `svg()` might be optional. - - BUG FIX: Fix warning in `stats::approx()` due to changes made in R - 3.6. +### Recent changes in princurve 2.1.5 (2020-08-13) - - DEFUNCT `principal.curve()` and `get.lam()`. +- BUG FIX `project_to_curve()`: Fix pass-by-reference bug, issue \#33. + Thanks to @szcf-weiya for detecting and fixing this bug! ## References Hastie, T. and Stuetzle, W., [Principal Curves](https://www.jstor.org/stable/2289936), JASA, Vol. 84, No. 406 (Jun., 1989), pp. 502-516, DOI: -[10.2307/2289936](http://doi.org/10.2307/2289936) +[10.2307/2289936](https://doi.org/10.2307/2289936) ([PDF](https://web.stanford.edu/~hastie/Papers/principalcurves.pdf)) diff --git a/cran-comments.md b/cran-comments.md index 20f2b5f..3d9f784 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,11 +1,14 @@ -# princurve 2.1.5 (2020-08-13) - - * BUG FIX `project_to_curve()`: Fix pass-by-reference bug, issue #33. Thanks - to @szcf-weiya for detecting and fixing this bug! +# princurve 2.1.6 + + * BUG FIX `project_to_curve()`: Return error message when `x` or `s` contain + insufficient rows. + + * BUG FIX unit tests: Switch from `svg()` to `pdf()` as support for `svg()` + might be optional. ## Test environments * localhost (before installation): - - Fedora 31, R 4.0.2 + - Fedora, R 4.0.2 * Github Actions (automated): - Mac OS X, R Release - Windows, R Release @@ -28,26 +31,21 @@ Summary: ``` -> revdepcheck::revdep_check(num_workers = 8, timeout = as.difftime(600, units = "mins")) -── INIT ─────────────────────────────────────────────────── Computing revdeps ── -── INSTALL ─────────────────────────────────────────────────────── 2 versions ── -Installing CRAN version of princurve -also installing the dependency ‘Rcpp’ -Installing DEV version of princurve -Installing 1 packages: Rcpp -── CHECK ──────────────────────────────────────────────────────── 10 packages ── -✓ aroma.light 3.18.0 ── E: 0 | W: 0 | N: 1 -✓ pathifier 1.26.0 ── E: 0 | W: 0 | N: 1 -✓ analogue 0.17-5 ── E: 0 | W: 0 | N: 0 -✓ RSDA 3.0.4 ── E: 1 | W: 0 | N: 0 -✓ ClusterSignificance 1.16.0 ── E: 0 | W: 0 | N: 0 -✓ FateID 0.1.9 ── E: 0 | W: 0 | N: 1 -✓ SCORPIUS 1.0.7 ── E: 0 | W: 0 | N: 0 -✓ MDSMap 1.1 ── E: 0 | W: 0 | N: 0 -✓ slingshot 1.6.1 ── E: 0 | W: 0 | N: 0 -✓ tradeSeq 1.2.01 ── E: 0 | W: 0 | N: 3 -OK: 10 +> revdepcheck::revdep_check(num_workers = 15, timeout = as.difftime(600, units = "mins")) +── CHECK ──────────────────────────────────────────────────────── 11 packages ── +✔ analogue 0.17-5 ── E: 1 | W: 0 | N: 0 +I ClusterSignificance 1.18.0 ── E: 1 | W: 0 | N: 1 +✔ pathifier 1.28.0 ── E: 0 | W: 0 | N: 1 +✔ aroma.light 3.20.0 ── E: 0 | W: 0 | N: 1 +✔ MDSMap 1.1 ── E: 1 | W: 0 | N: 0 +✔ slingshot 1.8.0 ── E: 1 | W: 0 | N: 1 +✔ RSDA 3.0.4 ── E: 1 | W: 0 | N: 0 +✔ FateID 0.1.9 ── E: 1 | W: 0 | N: 0 +✔ SCORPIUS 1.0.7 ── E: 0 | W: 0 | N: 0 +✔ mappoly 0.2.1 ── E: 1 | W: 0 | N: 0 +✔ tradeSeq 1.4.0 ── E: 1 | W: 0 | N: 0 +OK: 11 BROKEN: 0 -Total time: 11 min +Total time: 4 min ── REPORT ────────────────────────────────────────────────────────────────────── ``` diff --git a/man/figures/README_example-1.png b/man/figures/README_example-1.png index fb92adf..6c52d6c 100644 Binary files a/man/figures/README_example-1.png and b/man/figures/README_example-1.png differ diff --git a/man/figures/README_princurve-1.png b/man/figures/README_princurve-1.png index cabac18..69019ff 100644 Binary files a/man/figures/README_princurve-1.png and b/man/figures/README_princurve-1.png differ diff --git a/man/principal_curve.Rd b/man/principal_curve.Rd index 823928e..565a05b 100644 --- a/man/principal_curve.Rd +++ b/man/principal_curve.Rd @@ -102,7 +102,7 @@ whiskers(x, fit$s) Hastie, T. and Stuetzle, W., \href{https://www.jstor.org/stable/2289936}{Principal Curves}, JASA, Vol. 84, No. 406 (Jun., 1989), pp. 502-516, - DOI: \href{https://doi.org/10.2307/2289936}{10.2307/2289936} + \doi{10.2307/2289936} (\href{https://web.stanford.edu/~hastie/Papers/principalcurves.pdf}{PDF}). } \seealso{ diff --git a/man/princurve-package.Rd b/man/princurve-package.Rd index 4f83058..6982766 100644 --- a/man/princurve-package.Rd +++ b/man/princurve-package.Rd @@ -16,7 +16,7 @@ suggested by Jeff Banfield. Hastie, T. and Stuetzle, W., \href{https://www.jstor.org/stable/2289936}{Principal Curves}, JASA, Vol. 84, No. 406 (Jun., 1989), pp. 502-516, - DOI: \href{https://doi.org/10.2307/2289936}{10.2307/2289936} + \doi{10.2307/2289936} (\href{https://web.stanford.edu/~hastie/Papers/principalcurves.pdf}{PDF}). See also Banfield and Raftery (JASA, 1992). diff --git a/revdep/README.md b/revdep/README.md index e318223..fc80e4f 100644 --- a/revdep/README.md +++ b/revdep/README.md @@ -2,22 +2,28 @@ |field |value | |:--------|:-------------------------------| -|version |R version 4.0.2 (2020-06-22) | -|os |Fedora 32 (Workstation Edition) | +|version |R version 4.0.3 (2020-10-10) | +|os |Fedora 33 (Workstation Edition) | |system |x86_64, linux-gnu | |ui |RStudio | |language |(EN) | |collate |en_GB.UTF-8 | |ctype |en_GB.UTF-8 | |tz |Europe/Brussels | -|date |2020-08-14 | +|date |2021-01-17 | # Dependencies |package |old |new |Δ | |:---------|:-----|:-----|:--| -|princurve |2.1.4 |2.1.5 |* | -|Rcpp |1.0.5 |1.0.5 | | +|princurve |2.1.5 |2.1.6 |* | +|Rcpp |1.0.6 |1.0.6 | | # Revdeps +## Failed to check (1) + +|package |version |error |warning |note | +|:-------------------|:-------|:-----|:-------|:----| +|ClusterSignificance |1.18.0 |1 | |1 | + diff --git a/revdep/cran.md b/revdep/cran.md new file mode 100644 index 0000000..ebcb025 --- /dev/null +++ b/revdep/cran.md @@ -0,0 +1,7 @@ +## revdepcheck results + +We checked 11 reverse dependencies (6 from CRAN + 5 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package. + + * We saw 0 new problems + * We failed to check 0 packages + diff --git a/revdep/data.sqlite b/revdep/data.sqlite index 18a3ba8..162c0ba 100644 Binary files a/revdep/data.sqlite and b/revdep/data.sqlite differ diff --git a/revdep/failures.md b/revdep/failures.md index 9a20736..5f8714d 100644 --- a/revdep/failures.md +++ b/revdep/failures.md @@ -1 +1,46 @@ -*Wow, no problems at all. :)* \ No newline at end of file +# ClusterSignificance + +
+ +* Version: 1.18.0 +* GitHub: https://github.com/jasonserviss/ClusterSignificance +* Source code: https://github.com/cran/ClusterSignificance +* Date/Publication: 2020-10-27 +* Number of recursive dependencies: 85 + +Run `revdep_details(, "ClusterSignificance")` for more info + +
+ +## In both + +* checking whether package ‘ClusterSignificance’ can be installed ... ERROR + ``` + Installation failed. + See ‘/home/rcannood/workspace/vib/princurve/revdep/checks/ClusterSignificance/new/ClusterSignificance.Rcheck/00install.out’ for details. + ``` + +* checking package dependencies ... NOTE + ``` + Packages suggested but not available for checking: + 'BiocStyle', 'plsgenomics' + ``` + +## Installation + +### Devel + +``` +ERROR: dependency ‘scatterplot3d’ is not available for package ‘ClusterSignificance’ +* removing ‘/home/rcannood/workspace/vib/princurve/revdep/checks/ClusterSignificance/new/ClusterSignificance.Rcheck/ClusterSignificance’ + + +``` +### CRAN + +``` +ERROR: dependency ‘scatterplot3d’ is not available for package ‘ClusterSignificance’ +* removing ‘/home/rcannood/workspace/vib/princurve/revdep/checks/ClusterSignificance/old/ClusterSignificance.Rcheck/ClusterSignificance’ + + +``` diff --git a/tests/testthat/test-legacy_princurve.R b/tests/testthat/test-legacy_princurve.R index 6f65090..d833ca0 100644 --- a/tests/testthat/test-legacy_princurve.R +++ b/tests/testthat/test-legacy_princurve.R @@ -1,9 +1,9 @@ context("Comparing principal_curve and project_to_curve to legacy package") skip_on_cran() +skip_on_os("mac") -already_installed <- "princurvelegacy" %in% rownames(installed.packages()) -if (!already_installed) { +if (!requireNamespace("princurvelegacy", quietly = TRUE)) { devtools::install_github("rcannood/princurve@legacy") } @@ -37,7 +37,3 @@ for (i in seq_len(10)) { expect_equivalent(fit1$dist, fit2$dist, tolerance = .001) }) } - -if (!already_installed) { - remove.packages("princurvelegacy") -} diff --git a/tests/testthat/test-principal_curve.R b/tests/testthat/test-principal_curve.R index a8e188c..d40f6a1 100644 --- a/tests/testthat/test-principal_curve.R +++ b/tests/testthat/test-principal_curve.R @@ -4,17 +4,18 @@ z <- seq(-1, 1, length.out = 100) s <- cbind(z, z^2, z^3, z^4) x <- s + rnorm(length(s), mean = 0, sd = .005) -file <- tempfile(fileext = ".svg") -on.exit(unlink(file)) +file <- tempfile(fileext = ".png") + +on.exit(file.remove(file)) test_that("Testing principal_curve with smooth_spline", { - svg(file, 5, 5) + pdf(file, 5, 5) sink(file) fit <- principal_curve(x, smoother = "smooth_spline", plot_iterations = TRUE, trace = TRUE) sink() dev.off() - svg(file, 5, 5) + pdf(file, 5, 5) expect_error({ plot(fit) points(fit) @@ -42,11 +43,11 @@ test_that("Testing principal_curve with custom function", { stats::lowess(lambda, xj, ...)$y } - svg(file, 5, 5) + pdf(file, 5, 5) fit <- principal_curve(x, smoother = fun, plot_iterations = TRUE) dev.off() - svg(file, 5, 5) + pdf(file, 5, 5) expect_error({ plot(fit) points(fit) @@ -61,11 +62,11 @@ test_that("Testing principal_curve with custom function", { test_that("Testing principal_curve with a given start curve", { start <- matrix(c(0, 0, 0, 0, 1, 1, 1, 1), ncol = 4, byrow = TRUE) - svg(file, 5, 5) + pdf(file, 5, 5) fit <- principal_curve(x, smoother = "smooth_spline", start = start, plot_iterations = TRUE) dev.off() - svg(file, 5, 5) + pdf(file, 5, 5) expect_error({ plot(fit) points(fit) @@ -86,7 +87,7 @@ test_that("Expect principal_curve to error elegantly", { test_that("Testing principal_curve with lowess", { fit <- principal_curve(x, smoother = "lowess") - svg(file, 5, 5) + pdf(file, 5, 5) expect_error({ plot(fit) points(fit) @@ -104,7 +105,7 @@ x <- s + rnorm(length(s), mean = 0, sd = .005) test_that("Testing principal_curve with periodic_lowess", { fit <- principal_curve(x, smoother = "periodic_lowess") - svg(file, 5, 5) + pdf(file, 5, 5) expect_error({ plot(fit) points(fit) diff --git a/tests/testthat/test-project_to_curve.R b/tests/testthat/test-project_to_curve.R index dbe3f7f..9b9c890 100644 --- a/tests/testthat/test-project_to_curve.R +++ b/tests/testthat/test-project_to_curve.R @@ -190,12 +190,14 @@ test_that("Values are more or less correct, without stretch", { test_that("Expect project_to_curve to error elegantly", { - # expect_error(project_to_curve(list(1), list(1))) - # expect_error(project_to_curve(x = list(), s = s, stretch = 0)) - # expect_error(project_to_curve(x = x, s = list(), stretch = 0)) + expect_error(project_to_curve(list(1), list(1))) + expect_error(project_to_curve(x = list(), s = s, stretch = 0)) + expect_error(project_to_curve(x = x, s = list(), stretch = 0)) expect_error(project_to_curve(x, s, stretch = -1), "larger than or equal to 0") - # expect_error(project_to_curve(x, s, stretch = "10")) + expect_error(project_to_curve(x, s, stretch = "10")) expect_error(project_to_curve(x, cbind(s, s)), "must have an equal number of columns") + expect_error(project_to_curve(x, s[1,,drop=FALSE]), "at least two rows") + expect_error(project_to_curve(x[integer(0),,drop=FALSE], s), "at least one row") })