diff --git a/.Rbuildignore b/.Rbuildignore index 0fb0de0..8dd02e4 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -4,3 +4,7 @@ ^\.git$ ^README\.Rmd$ cran-comments.md +^\.github$ +^_pkgdown\.yml$ +^docs$ +^pkgdown$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..a3ac618 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,49 @@ +# 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: [main, master] + pull_request: + branches: [main, master] + +name: R-CMD-check + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + 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@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + 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: + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..ed7650c --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,48 @@ +# 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: [main, master] + pull_request: + branches: [main, master] + release: + types: [published] + workflow_dispatch: + +name: pkgdown + +jobs: + pkgdown: + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.4.1 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 0000000..2c5bb50 --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,50 @@ +# 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: [main, master] + pull_request: + branches: [main, master] + +name: test-coverage + +jobs: + test-coverage: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::covr + needs: coverage + + - name: Test coverage + run: | + covr::codecov( + quiet = FALSE, + clean = FALSE, + install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") + ) + shell: Rscript {0} + + - name: Show testthat output + if: always() + run: | + ## -------------------------------------------------------------------- + find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true + shell: bash + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v3 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package diff --git a/.gitignore b/.gitignore index 7b732e7..7c06555 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ .RData .Ruserdata .DS_Store +docs diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3707883..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: r -cache: packages -matrix: - include: - - r: oldrel - os: linux - - r: release - os: linux - - r: devel - os: linux - - r: release - os: osx -r_packages: - - covr -after_success: - - R -e 'covr::codecov()' diff --git a/README.Rmd b/README.Rmd index 3bbb98b..7a156f0 100644 --- a/README.Rmd +++ b/README.Rmd @@ -3,7 +3,9 @@ title: "lmds" output: github_document --- -[![Build Status](https://travis-ci.org/dynverse/lmds.svg?branch=master)](https://travis-ci.org/dynverse/lmds) + + [![R-CMD-check](https://github.com/dynverse/lmds/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/dynverse/lmds/actions/workflows/R-CMD-check.yaml) + ```{r setup, include = FALSE} diff --git a/README.md b/README.md index 42c7a52..dbbf8da 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ lmds ================ -[![Build -Status](https://travis-ci.org/dynverse/lmds.svg?branch=master)](https://travis-ci.org/dynverse/lmds) + +[![R-CMD-check](https://github.com/dynverse/lmds/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/dynverse/lmds/actions/workflows/R-CMD-check.yaml) + # `lmds`: Landmark Multi-Dimensional Scaling @@ -17,12 +18,14 @@ library(lmds) x <- as.matrix(iris[,1:4]) dimred <- lmds(x, ndim = 2) qplot(dimred[,1], dimred[,2]) + labs(title = "lmds()") + theme_classic() +#> Warning: `qplot()` was deprecated in ggplot2 3.4.0. +#> This warning is displayed once every 8 hours. +#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated. ``` ``` r - dimred <- cmdscale(dist(x)) qplot(dimred[,1], dimred[,2]) + labs(title = "cmdscale()") + theme_classic() ``` @@ -37,8 +40,7 @@ dataset size. ## Latest changes Check out `news(package = "lmds")` or [NEWS.md](NEWS.md) for a full list -of -changes. +of changes. @@ -46,7 +48,7 @@ changes. Initial release of lmds. - - A fast dimensionality reduction method scaleable to large numbers of +- A fast dimensionality reduction method scaleable to large numbers of samples. Landmark Multi-Dimensional Scaling (LMDS) is an extension of classical Torgerson MDS, but rather than calculating a complete distance matrix between all pairs of samples, only the distances diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..d71acfb --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,4 @@ +url: ~ +template: + bootstrap: 5 + diff --git a/man/figures/compare-1.png b/man/figures/compare-1.png index 25d6e69..eef9eba 100644 Binary files a/man/figures/compare-1.png and b/man/figures/compare-1.png differ diff --git a/man/figures/compare-2.png b/man/figures/compare-2.png index d3d800c..61982d8 100644 Binary files a/man/figures/compare-2.png and b/man/figures/compare-2.png differ diff --git a/man/figures/timings-1.png b/man/figures/timings-1.png index 6607ecf..c602736 100644 Binary files a/man/figures/timings-1.png and b/man/figures/timings-1.png differ