From d9152071599731f73b588fbe5a1d18196261f0f0 Mon Sep 17 00:00:00 2001 From: Piotr Sobczyk Date: Mon, 14 Aug 2023 10:21:51 +0200 Subject: [PATCH 1/4] adding build in github actions --- .Rbuildignore | 4 +++ .github/workflows/R-CMD-check.yml | 60 +++++++++++++++++++++++++++++++ DESCRIPTION | 6 ++-- NAMESPACE | 1 + R/pesel.R | 2 ++ R/pesel_package.R | 1 + README.md | 3 +- man/plot.pesel.result.Rd | 3 ++ man/print.pesel.result.Rd | 3 ++ 9 files changed, 78 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/R-CMD-check.yml diff --git a/.Rbuildignore b/.Rbuildignore index ba40c04..f5f593b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -2,3 +2,7 @@ ^\.Rproj\.user$ ^.travis.yml$ ^\.travis\.yml$ +.gitignore +.travis.yml +.Rproj.user +.git diff --git a/.github/workflows/R-CMD-check.yml b/.github/workflows/R-CMD-check.yml new file mode 100644 index 0000000..5920265 --- /dev/null +++ b/.github/workflows/R-CMD-check.yml @@ -0,0 +1,60 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# +# See https://github.com/r-lib/actions/tree/master/examples#readme for +# additional example workflows available for the R community. + +name: R-CMD-check + +on: + push: + branches: [ master, fixing-workflow ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r-version }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macos-latest, r-version: 'release'} + - {os: windows-latest, r-version: 'release'} + - {os: ubuntu-18.04, r-version: 'devel'} + - {os: ubuntu-18.04, r-version: 'release'} + - {os: ubuntu-18.04, r-version: 'oldrel'} + + steps: + - uses: actions/checkout@v2 + - name: Set up R ${{ matrix.r-version }} + uses: r-lib/actions/setup-r@v1 + with: + r-version: ${{ matrix.r-version }} + - uses: r-lib/actions/setup-pandoc@v1 + + - name: Install system dependencies + if: runner.os == 'Linux' + env: + RHUB_PLATFORM: linux-x86_64-ubuntu-gcc + run: sudo apt-get install -y libcurl4-openssl-dev + + - uses: r-lib/actions/setup-r-dependencies@v1 + with: + extra-packages: rcmdcheck + + - name: Check + run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning", check_dir = "check") + shell: Rscript {0} + + - name: Upload check results + if: failure() + uses: actions/upload-artifact@master + with: + name: ${{ runner.os }}-r${{ matrix.config.r-version }}-results + path: check diff --git a/DESCRIPTION b/DESCRIPTION index 2fabf3b..ff7bf92 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -7,7 +7,7 @@ Author: Piotr Sobczyk, Julie Josse, Malgorzata Bogdan Maintainer: Piotr Sobczyk Description: Automatic estimation of number of principal components in PCA with PEnalized SEmi-integrated Likelihood (PESEL). See Piotr Sobczyk, Malgorzata Bogdan, Julie Josse - 'Bayesian dimensionality reduction with PCA using penalized semi-integrated likelihood' + "Bayesian dimensionality reduction with PCA using penalized semi-integrated likelihood" (2017) . License: GPL-3 Encoding: UTF-8 @@ -18,5 +18,5 @@ Depends: Imports: stats, graphics -LazyData: TRUE -RoxygenNote: 7.1.1 +LazyData: FALSE +RoxygenNote: 7.2.3 diff --git a/NAMESPACE b/NAMESPACE index 2af8a83..3e77197 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -8,3 +8,4 @@ export(pesel_homogeneous) importFrom(graphics,plot) importFrom(graphics,points) importFrom(stats,cov) +importFrom(utils,head) diff --git a/R/pesel.R b/R/pesel.R index 9231d08..2f436d7 100644 --- a/R/pesel.R +++ b/R/pesel.R @@ -137,6 +137,7 @@ pesel <- function(X, npc.min = 0, npc.max = 10, prior = NULL, scale = TRUE, #' @param posterior a boolean, if TRUE (default value) then posterior probablities are plotted #' otherwise values of PeSeL criterion are plotted #' @param ... Further arguments to be passed to or from other methods. They are ignored in this function. +#' @return No return value, called for side effects #' @export #' @keywords internal plot.pesel.result <- function(x, posterior = TRUE, ...){ @@ -158,6 +159,7 @@ pesel <- function(X, npc.min = 0, npc.max = 10, prior = NULL, scale = TRUE, #' #' @param x pesel.result class object #' @param ... Further arguments to be passed to or from other methods. They are ignored in this function. +#' @return No return value, called for side effects #' @export #' @keywords internal print.pesel.result <- function(x,...){ diff --git a/R/pesel_package.R b/R/pesel_package.R index 28e5984..6ae6c6a 100644 --- a/R/pesel_package.R +++ b/R/pesel_package.R @@ -8,6 +8,7 @@ #' @name pesel-package #' @importFrom stats cov #' @importFrom graphics plot points +#' @importFrom utils head #' @author{ Piotr Sobczyk, #' Julie Josse, #' Malgorzata Bogdan diff --git a/README.md b/README.md index bf5378a..b1af07e 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/pesel)](http://cran.r-project.org/package=pesel) [![Downloads](http://cranlogs.r-pkg.org/badges/pesel)](http://cran.rstudio.com/package=pesel) -[![Build Status](https://api.travis-ci.org/psobczyk/pesel.png)](https://travis-ci.org/psobczyk/pesel) - +[![R build status](https://github.com/psobczyk/pesel/workflows/R-CMD-check/badge.svg)](https://github.com/psobczyk/pesel/actions?query=workflow%3AR-CMD-check) [](http://www.ideal.rwth-aachen.de/) ------------- diff --git a/man/plot.pesel.result.Rd b/man/plot.pesel.result.Rd index fdf8a5c..5c37cdb 100644 --- a/man/plot.pesel.result.Rd +++ b/man/plot.pesel.result.Rd @@ -14,6 +14,9 @@ otherwise values of PeSeL criterion are plotted} \item{...}{Further arguments to be passed to or from other methods. They are ignored in this function.} } +\value{ +No return value, called for side effects +} \description{ Plot pesel.result class object } diff --git a/man/print.pesel.result.Rd b/man/print.pesel.result.Rd index d903acf..20e70d4 100644 --- a/man/print.pesel.result.Rd +++ b/man/print.pesel.result.Rd @@ -11,6 +11,9 @@ \item{...}{Further arguments to be passed to or from other methods. They are ignored in this function.} } +\value{ +No return value, called for side effects +} \description{ Print pesel.result class object } From e89d843e9456d4ca6f819a1de0e9062f58291b21 Mon Sep 17 00:00:00 2001 From: Piotr Sobczyk Date: Mon, 14 Aug 2023 10:32:51 +0200 Subject: [PATCH 2/4] updated workflow --- .Rbuildignore | 1 + .github/workflows/R-CMD-check.yml | 69 +++++++++++++------------------ README.md | 3 +- pesel.Rproj | 1 + 4 files changed, 33 insertions(+), 41 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index f5f593b..5b3338d 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -6,3 +6,4 @@ .travis.yml .Rproj.user .git +.github diff --git a/.github/workflows/R-CMD-check.yml b/.github/workflows/R-CMD-check.yml index 5920265..a3ac618 100644 --- a/.github/workflows/R-CMD-check.yml +++ b/.github/workflows/R-CMD-check.yml @@ -1,60 +1,49 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# -# See https://github.com/r-lib/actions/tree/master/examples#readme for -# additional example workflows available for the R community. - -name: R-CMD-check - +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - branches: [ master, fixing-workflow ] + branches: [main, master] pull_request: - branches: [ master ] + branches: [main, master] + +name: R-CMD-check jobs: - build: + R-CMD-check: runs-on: ${{ matrix.config.os }} - name: ${{ matrix.config.os }} (${{ matrix.config.r-version }}) + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) strategy: fail-fast: false matrix: config: - - {os: macos-latest, r-version: 'release'} - - {os: windows-latest, r-version: 'release'} - - {os: ubuntu-18.04, r-version: 'devel'} - - {os: ubuntu-18.04, r-version: 'release'} - - {os: ubuntu-18.04, r-version: 'oldrel'} + - {os: macos-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v2 - - name: Set up R ${{ matrix.r-version }} - uses: r-lib/actions/setup-r@v1 - with: - r-version: ${{ matrix.r-version }} - - uses: r-lib/actions/setup-pandoc@v1 + - uses: actions/checkout@v3 - - name: Install system dependencies - if: runner.os == 'Linux' - env: - RHUB_PLATFORM: linux-x86_64-ubuntu-gcc - run: sudo apt-get install -y libcurl4-openssl-dev + - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-r-dependencies@v1 + - uses: r-lib/actions/setup-r@v2 with: - extra-packages: rcmdcheck + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true - - name: Check - run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning", check_dir = "check") - shell: Rscript {0} + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check - - name: Upload check results - if: failure() - uses: actions/upload-artifact@master + - uses: r-lib/actions/check-r-package@v2 with: - name: ${{ runner.os }}-r${{ matrix.config.r-version }}-results - path: check + upload-snapshots: true diff --git a/README.md b/README.md index b1af07e..33e2d60 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ -[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/pesel)](http://cran.r-project.org/package=pesel) + +[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/pesel)](https://cran.r-project.org/web/packages/pesel/index.html) [![Downloads](http://cranlogs.r-pkg.org/badges/pesel)](http://cran.rstudio.com/package=pesel) [![R build status](https://github.com/psobczyk/pesel/workflows/R-CMD-check/badge.svg)](https://github.com/psobczyk/pesel/actions?query=workflow%3AR-CMD-check) [](http://www.ideal.rwth-aachen.de/) diff --git a/pesel.Rproj b/pesel.Rproj index 526ad2d..42b95bd 100644 --- a/pesel.Rproj +++ b/pesel.Rproj @@ -18,4 +18,5 @@ StripTrailingWhitespace: Yes BuildType: Package PackageUseDevtools: Yes PackageInstallArgs: --no-multiarch --with-keep.source +PackageCheckArgs: --as-cran PackageRoxygenize: rd,collate,namespace,vignette From 9f688cfcb70022d1a4a8a5f5d97a02480096781a Mon Sep 17 00:00:00 2001 From: Piotr Sobczyk Date: Mon, 14 Aug 2023 10:43:05 +0200 Subject: [PATCH 3/4] updated versions --- DESCRIPTION | 4 ++-- R/pesel_package.R | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ff7bf92..ed1ce69 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: pesel Type: Package Title: Automatic Estimation of Number of Principal Components in PCA -Version: 0.7.4 -Date: 2021-06-13 +Version: 0.7.5 +Date: 2023-08-14 Author: Piotr Sobczyk, Julie Josse, Malgorzata Bogdan Maintainer: Piotr Sobczyk Description: Automatic estimation of number of principal components in PCA diff --git a/R/pesel_package.R b/R/pesel_package.R index 6ae6c6a..a34836e 100644 --- a/R/pesel_package.R +++ b/R/pesel_package.R @@ -3,7 +3,7 @@ #' @description Automatic estimation of number of principal components in PCA #' with PEnalized SEmi-integrated Likelihood (PESEL). #' -#' @details Version: 0.7.4 +#' @details Version: 0.7.5 #' @docType package #' @name pesel-package #' @importFrom stats cov From f82a36029799d58eca5080d104df065da86e1c2a Mon Sep 17 00:00:00 2001 From: Piotr Sobczyk Date: Mon, 14 Aug 2023 10:51:21 +0200 Subject: [PATCH 4/4] updated docs --- DESCRIPTION | 1 - R/pesel_package.R | 2 +- man/pesel-package.Rd | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ed1ce69..84d82db 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -18,5 +18,4 @@ Depends: Imports: stats, graphics -LazyData: FALSE RoxygenNote: 7.2.3 diff --git a/R/pesel_package.R b/R/pesel_package.R index a34836e..1bf8972 100644 --- a/R/pesel_package.R +++ b/R/pesel_package.R @@ -16,7 +16,7 @@ #' Maintainer: Piotr Sobczyk \email{pj.sobczyk@@gmail.com} #' } #' @references Piotr Sobczyk, Malgorzata Bogdan, Julie Josse -#' \emph{Bayesian dimensionality reduction with PCA using penalized semi-integrated likelihood}, +#' "Bayesian dimensionality reduction with PCA using penalized semi-integrated likelihood", #' Journal of Computational and Graphical Statistics 2017 #' #' @examples diff --git a/man/pesel-package.Rd b/man/pesel-package.Rd index 80fbff1..fec1923 100644 --- a/man/pesel-package.Rd +++ b/man/pesel-package.Rd @@ -9,7 +9,7 @@ Automatic estimation of number of principal components in PCA with PEnalized SEmi-integrated Likelihood (PESEL). } \details{ -Version: 0.7.4 +Version: 0.7.5 } \examples{ # EXAMPLE 1 - noise @@ -31,7 +31,7 @@ pesel(X) } \references{ Piotr Sobczyk, Malgorzata Bogdan, Julie Josse -\emph{Bayesian dimensionality reduction with PCA using penalized semi-integrated likelihood}, +"Bayesian dimensionality reduction with PCA using penalized semi-integrated likelihood", Journal of Computational and Graphical Statistics 2017 } \author{