From 9356ddf4fbb41c5988abc57c9363c14b9c4c6fc3 Mon Sep 17 00:00:00 2001 From: John Lepird Date: Sun, 13 Apr 2025 09:03:44 -0400 Subject: [PATCH] Fix PRCI + Add Downloads Tile --- .Rbuildignore | 1 + .github/workflows/r.yml | 68 +++++++++++++++++++++++------------------ .vscode/tasks.json | 14 +++++++++ R/inference.R | 2 -- README.md | 1 + 5 files changed, 54 insertions(+), 32 deletions(-) create mode 100644 .vscode/tasks.json diff --git a/.Rbuildignore b/.Rbuildignore index 2624f10..6ffb41d 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -11,3 +11,4 @@ ^docs$ ^pkgdown$ ^\.github$ +^\.vscode$ diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index 480c534..55219db 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -1,43 +1,51 @@ -# 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 - +# 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 ] + branches: [main, master] pull_request: - branches: [ master ] -permissions: - contents: read +name: R-CMD-check.yaml + +permissions: read-all jobs: - build: - runs-on: ubuntu-latest + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + strategy: + fail-fast: false matrix: - r-version: ['4.1.3', devel] - platform: [ubuntu-latest, macos-latest, windows-latest] + config: + - {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@v3 - - uses: r-lib/actions/setup-pandoc@v1 - with: - pandoc-version: '2.7.3' - - name: Set up R ${{ matrix.r-version }} - uses: r-lib/actions/setup-r@f57f1301a053485946083d7a45022b278929a78a + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 with: - r-version: ${{ matrix.r-version }} + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + - uses: r-lib/actions/setup-r-dependencies@v2 with: - cache-version: 2 - extra-packages: | - rcmdcheck - - uses: r-lib/actions/setup-tinytex@v2 - - uses: r-lib/actions/check-r-package@v1 \ No newline at end of file + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..1971503 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,14 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "type": "R", + "code": [ + "devtools::build()" + ], + "group": "build", + "problemMatcher": [], + "label": "R: Build" + } + ] +} \ No newline at end of file diff --git a/R/inference.R b/R/inference.R index f5f669a..3c2a4fd 100644 --- a/R/inference.R +++ b/R/inference.R @@ -1,5 +1,3 @@ -library(mcmc) - #' A function that estimates the user's underlying utility function. #' @examples #' p <- prefEl(data = data.frame(c(1,0,1), c(0,1,1), c(1,1,1)), diff --git a/README.md b/README.md index 5e66fa5..73d592e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ ### Package Status [![R](https://github.com/jlepird/prefeR/actions/workflows/r.yml/badge.svg?branch=master)](https://github.com/jlepird/prefeR/actions/workflows/r.yml) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/prefeR)](https://cran.r-project.org/package=prefeR) +[![](https://cranlogs.r-pkg.org/badges/prefeR)](https://cran.r-project.org/package=prefeR) ### What is preference elicitation? Most real-world decisions must reconcile multiple, competing objectives. In buying a car, you might be concerned about cost, reliability, and performance, but before you can make a decision, you must establish the relative importance of these goals. A common mathematical approach to this problem is to define weights for each of these objectives. Although you might have a ballpark intuition for the weights, it is difficult to set them in a repeatable and defendable manner.