Skip to content

Commit

Permalink
Merging 'develop' into 'main' (#416)
Browse files Browse the repository at this point in the history
* Wrote and executed watchdog

* Add 'thevalidatoR' gh-action to generate a report on the release

see https://github.com/marketplace/actions/r-package-validation-report

* fixed formatting

* Prototype

* reformatting

* major cleanup

* added more sanity checks

* Implemented compatibility for y-axis transformations and wrote some tests

* More tests and now robust to fun=log

* now robust against all function input?

* Changed behaviour so that test aso works on CRAN and not only local

* Added tests for incorrect arguments

* Minor formatting changes

* Dummy for the auto-deploy to shinyapps

* Update deploy_to_shinyapps.yml

* Update DESCRIPTION

* Implemented Stevens suggestions

* Removed parcats from imports, moved DT and gt to suggests, updated mans

* align_plots: make more user friendly

* add_risktabel: adjust ylabel according to increase in 4th column in grob of graph

* Updated testing

* - split visr testing file for each method
- added more tests for visr survfit
- updated visR to align with expectations
- default method should not be a test. It should provide a default way of plotting objects

* Camelcase to snakecase; minor formatting; initial vdiffr

* forgot to save vdiffr changes

* fixed bug since bools get translated to 0/1 which gets forwarded to base::plot and doesn't fail

* Fixed formatting for CRAN compatibility

* Fixed bug in testing

* in progress

* Update estimate_CUMINC.R

* working on merge conflict

* Wrote and executed watchdog

* fixed formatting

* reformatting

* major cleanup

* Implemented Stevens suggestions

* working on merge conflict

* Delete deploy_to_shinyapps.yml

* package check update

* in progress

* Update check-standard.yaml

* updates

* Update check-standard.yaml

* Update estimate_CUMINC.R

* updates

* Update DESCRIPTION

* Update DESCRIPTION

* Update DESCRIPTION

* updates after review

* in progress

* updates

* doc updates

* first draft complete

* init

* Update test-estimate_CUMINC.R

* misc updates

* doc updates

* Delete .Rprofile

* Update DESCRIPTION

* fix, now working on tests

* Converting output to data.frame now

* Extended watchdog to append END OF CODE section at the end of the file

* addition of END OF CODE sections

* Changed commit-date to ISO format (YYYY-MM-DDTHH:MM:SS)

* updates

* Updated testing

* updates after review

* updates

* Update DESCRIPTION

* rename

* re-document

* Update test-estimate_CUMINC.R

* minor edit on test

* Removed glue dependency

* Re-build README.Rmd

* Updated test 6.4

* Updated last-update-when-header

* Attempt to fix riskmetric score in readme

* Update README.Rmd

* Attempt to fix riskmetric score in Readme

* Update README.Rmd

* Update README.Rmd

* Removed unused snaps

* Update rebuild-readme.yaml

* Update rebuild-readme.yaml

* Update README.Rmd

* Update README.Rmd

* Update rebuild-readme.yaml

* Update rebuild-readme.yaml

* Update README.Rmd

* Update README.Rmd

* Update test-coverage.yaml

* Update rebuild-readme.yaml

* Update README.Rmd

* Update rebuild-readme.yaml

* Update rebuild-readme.yaml

* Update rebuild-readme.yaml

* Update rebuild-readme.yaml

* Update rebuild-readme.yaml

* Re-build README.Rmd

* Update rebuild-readme.yaml

* Update README.Rmd

* Update test-coverage.yaml

* Fixed small error in numbering of tests

* Adding cumulative events and censored obs to survfit `*_risktable()` fns

* Updated to align legend labels with strata specified

* Re-build README.Rmd

* remove tidyselect dependency

* removing magrittr dep

* don't reexport %||%

* Regenerated man file for estimate_cuminc after rename

* Update get_risktable.R

* renamed cumulative.* to cum.*

* Updated testing for PR310

* Included survfit object to tidyme output as attribute
Included broom colname nomenclature in tidyme output

* Re-build README.Rmd

* update naming in visR as well

* fixed bug

* Updated documentation and added CRAN check \value tag exceptions to watchdog

* Fixed typo in test, now package check is back at 0/0/0

* Fixed threeway test

* Made new test less ambigous; minor formatting

* Readress issue

* adressed comments

* Re-build README.Rmd

* risktable updates

* Re-build README.Rmd

* rlang prefix updates

* Re-build README.Rmd

* adding images of rendered tableone() tables in help file

* Re-build README.Rmd

* Update README.Rmd

* Re-build README.Rmd

* Specified riskmetric version to avoid breaking 0.1.2

* Reverted useless change

* Re-build README.Rmd

* Integrate learnR vignette and shinyapps.io autodeploy  (#339)

* Update DESCRIPTION

* Created deploy_to_shinyapps.yml

* Changed branch to be deployed to develop

* Added gt to suggests

* Re-build README.Rmd

* Added test for external data used in vignettes

* Re-build README.Rmd

Co-authored-by: GitHub Actions <actions@github.com>

* Added link target of shinyapps autodeploy

* Adding R CMD Checks for older versions of R (#324)

* workflow updates

* Re-build README.Rmd

* plot() fix

* Fix broken code and updated vignettes

* Update test-watchdog_testfiles.R

* Re-build README.Rmd

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: shaesen2 <shaesen2@its.jnj.com>
Co-authored-by: Tim Treis <tim.treis@outlook.de>

* Build `README.Rmd` on main branch instead of all PRs (#342)

* build on main instead of all PRs

* Update rebuild-readme.yaml

Co-authored-by: Tim Treis <tim.treis@outlook.de>

* Changed R version to be shinyapps.io compatible

* Reverted "build README on main" because bot can't push to write-protected branch

* Updates to website (#345)

* first draft of updated website

* Update _pkgdown.yml

* Updated NEWS with changelog (#349)

* Updated NEWS with changelog
Quick fixes for readme to remove contributor stats and cover stats (can be accessed through the badge)

* fixed typo

* fixed typo

* Re-build README.Rmd

* update ReadMe and trigger readme flow from inside pushed branch

* Re-build README.Rmd

* Implemented review and adjusted readme.RMD

* Re-build README.Rmd

* fixed readme

* fixed readme

* dunno

* Re-build README.Rmd

* Updated contributors

* Re-build README.Rmd

* Adressed review comments
- Badges side-by-side
- Updated NEWS

Co-authored-by: shaesen2 <shaesen2@its.jnj.com>
Co-authored-by: GitHub Actions <actions@github.com>

* Create contributing (#326)

* Create contributing

* Re-build README.Rmd

* Updated contributing

* Re-build README.Rmd

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Mark Baillie <bailliem@gmail.com>
Co-authored-by: shaesen2 <shaesen2@its.jnj.com>

* Updated the strata levels and label in `visr()`  (#348)

* updating default strata labels/headers

* label updates

* Re-build README.Rmd

* Update DESCRIPTION

* Update add_CNSR.R

* Re-build README.Rmd

* updates after review

* doc update

* Update test-estimate_KM.R

* Re-build README.Rmd

* Update estimate_cuminc.R

* updates after review

* doc updates

* Re-build README.Rmd

* review updates

* more review updates

* estimate_KM
Updated tests to be more clear
Updated comments to make more clear

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: shaesen2 <shaesen2@its.jnj.com>

* NEWS entry update (#351)

* updated news and increment version number

* Update NEWS.md

* Re-build README.Rmd

Co-authored-by: GitHub Actions <actions@github.com>

* Create PR template (#330)

* Create PULL_

* Re-build README.Rmd

* Update PR template

* Updated based on review

* Re-build README.Rmd

* Re-build README.Rmd

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: shaesen2 <shaesen2@its.jnj.com>
Co-authored-by: Tim Treis <tim.treis@outlook.de>
Co-authored-by: Daniel Sjoberg <danield.sjoberg@gmail.com>

* Adding vignette example for estimate_cuminc() (#355)

* adding vignette example for estimate_cuminc()

* Re-build README.Rmd

* Updated vignettes

* Re-build README.Rmd

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: shaesen2 <shaesen2@its.jnj.com>

* Added update_documentation to quickly update everything and generate … (#356)

* Added update_documentation to quickly update everything and generate documentation/visR.pdf

Updated S3 method roxygen

* Removed update_documentation
implemented review comments

* Increment version number to 0.2.0.9001

Co-authored-by: shaesen2 <shaesen2@its.jnj.com>
Co-authored-by: Daniel Sjoberg <danield.sjoberg@gmail.com>

* Updates to `class()` calls (#359)

* class updates

* Update test-watchdog_testfiles.R

* Re-build README.Rmd

* Further updates to class vs inherits

* Delete visR.pdf

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: shaesen2 <shaesen2@its.jnj.com>

* Review of Joanna testing (#361)

* Review of Joanna testing

estimate_cuminc
--------------
- Initialize data argument
- focus on arguments that are required for ADaM eg confint can be defined through ... Tidycmprisk should deal with confint variations
- add more informative messages
- Do we want to add an overall strata? We can put Overall instead of 1 inside the formula and then add a column strat99= Overall
- %||% is not defined. When strata is NULL then the formula becomes ...... ~ NULL in the final object without any error => used ifelse statement

testing
-------
- we need to focus on what the wrapper is doing, not on what the tidycmprisk function
 -- test arguments
 -- test excecuting surrounding the main function
 -- do not test how the main function works
- downstream processing of this object needs to be tested in the respective test files, not in the estimate function
- we expect tidycmprisk to do the heavy lifting and testing on the final object. We only verify wether the wrapper does not change the object. If it do

* Re-build README.Rmd

* review updates

* Update _pkgdown.yml

* adding `visR::` prefix in examples

* review updates from call

* Re-build README.Rmd

* update for conf.int

* Re-build README.Rmd

* redocument

Co-authored-by: shaesen2 <shaesen2@its.jnj.com>
Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Daniel Sjoberg <danield.sjoberg@gmail.com>

* Test/add annotation cuminc updates  (#364)

* update T1 to include cuminc test

* update T2 to include cuminc tests

* update T3 to include cuminc

* update T5 to include cuminc

* update T6

* Fix T3.2 extracted_lbl

* spell check updates (#372)

* spell check updates

* Re-build README.Rmd

Co-authored-by: GitHub Actions <actions@github.com>

* Update README.Rmd by tableone (#369)

* Update README.Rmd by tableone

* Re-build README.Rmd

* installing and rendering readme

* Re-build README.Rmd

* updates

* Update README.md

* Update NEWS.md

* Increment version number to 0.2.0.9002

* Re-build README.Rmd

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Daniel Sjoberg <danield.sjoberg@gmail.com>

* Added table.height to add_risktable (#353)

* Added table.height to add_risktable

* Re-build README.Rmd

* unit tests were added

* Complete tests + rename var + doc

* Added small fixes

* Delete test-estimate_CUMINC.R

* fix doc reference

* Re-build README.Rmd

* Update rowgutter default value

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: shaesen2 <shaesen2@its.jnj.com>
Co-authored-by: Daniel Sjoberg <danield.sjoberg@gmail.com>

* Update readme tableone display (#376)

* update readme tableone display

* Re-build README.Rmd

* Re-build README.Rmd

Co-authored-by: GitHub Actions <actions@github.com>

* Add na.rm option to remove the strata variable in rows (#368)

* Add na.rm option to remove the strata variable in rows

* update unit tests

* Re-build README.Rmd

* remove na.rm and applied strata filteration

* Re-build README.Rmd

* Update test-get_tableone.R

* Update WORDLIST

* increment version number

* Re-build README.Rmd

Co-authored-by: Daniel Sjoberg <danield.sjoberg@gmail.com>
Co-authored-by: GitHub Actions <actions@github.com>

* Removing warning in `visr()` when PARAMCD not present (#380)

* Update visr.R

* Update test-visr_survfit.R

* Re-build README.Rmd

* documentation update

* doc updates

* increment version number

* Re-build README.Rmd

Co-authored-by: GitHub Actions <actions@github.com>

* Replaced `survfit` call with quo (#366)

* replace survfit call with quo

* Re-build README.Rmd

* Update test-get_pvalue.R

* Re-build README.Rmd

* Update get_COX_HR.R

* Re-build README.Rmd

* Update test-watchdog_testfiles.R

* Re-build README.Rmd

* small adjustments to improve readability

* Re-build README.Rmd

* updates from review

* Re-build README.Rmd

* Re-build README.Rmd

* doc update

* Re-build README.Rmd

* Re-build README.Rmd

* Added prefix for testthat.
Updated documentation for estimate_KM.
Removed warning param/paramcd.

* Re-build README.Rmd

* review updates

* Re-build README.Rmd

* increment version number

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: shaesen2 <shaesen2@its.jnj.com>

* Adding unit tests with cumulative inc. (#387)

* adding unit tests

* Update get_risktable.Rd

* visr survfit check (#389)

* WIP: start documenting all functions in render.R

* WIP: add roygen skeleton

* WIP: remove export for all summarize functions

* WIP: remove export for align_plots function

* WIP: remove export from get_tableone function

* WIP: remove export from get_summary function

* WIP: remove export from lhs/pipe function

* WIP: remove export for get_risktable and quantilte funcs

* Remove lifecycle badge and text. Move remaining badges under installation.

* Re-build README.Rmd

* add lifecycle to description and experimental badge to render function

* document royxgen headings for all functions in render.R.
compile documentation.

* export what is needed

* export what is needed

* Re-build README.Rmd

* move badge location to under first section -

* Re-build README.Rmd

* adding lifecycle to wordlist

* bump package increment

* export
* get_summary
* align_plots

* package bump

* tidy up methods of the same s3 class and remove duplication in docs

* Re-build README.Rmd

* roll back some of the export deletions. trigging test failures and also required for vignettes, examples.
* get_*
* utils pipe
* utilts table

* Re-build README.Rmd

* WIP: connect the s3 methods for summarize through document.

* Tidy up tags

* clean up typo and build docs

* bump package
add experimental tag to get_tableone

* Adding agument `estimate_KM(formula=)` (#390)

* adding formula argument

* adding lifecycle badges

* doc update

* Re-build README.Rmd

* Update test-estimate_KM.R

* Re-build README.Rmd

* cleaning up before requesting review

* review comment updates

* typo

* Update estimate_KM.R

* doc update

* Re-build README.Rmd

* updates

* increment version number

Co-authored-by: GitHub Actions <actions@github.com>

* Updated to GH Actions V2

* Re-build README.Rmd

* Add instruction to check if the readme has been rendered manually. (#404)

* Add instruction to check if the readme has been rendered manually.

* build readme

* Updates from review estimate_KM (#405)

* Updated estimate KM testing
Updated estimate KM documentation to ensure to user knows that we allow non-CDISC. This was not clear.

* Ran `usethis::use_tidy_description()` to put DESCRIPTION entries in standard order

* docs

* re-adding the error message that was removed.

* docs

Co-authored-by: shaesen2 <shaesen2@its.jnj.com>
Co-authored-by: Daniel Sjoberg <danield.sjoberg@gmail.com>

* Documentation updates (#409)

* doc updates

* doc updates

* Adding `Surv_CNSR()` function (#397)

* Create Surv_CDISC.R

* updates

* doc update

* Re-build README.Rmd

* Update Surv_CDISC.R

* Re-build README.Rmd

* Update Surv_CDISC.R

* Re-build README.Rmd

* doc updates

* Re-build README.Rmd

* Update NAMESPACE

* merge conflict fix

* Re-build README.Rmd

* updates

* Re-build README.Rmd

* Update test-Surv_CDISC.R

* Re-build README.Rmd

* readme

* doc updates from review

* doc updates

* Update test-Surv_CDISC.R

* Update testing:
- consistent with CDISC philosophy
- check the actual requirement
- remove req T2.5 as this is not a requirement of our function, but something tested in the backend of survival

* removed requirement 2.3 in TOC

* change function name

* Update testing
Included CNSR info in estimate_KM to ensure user will restrict to 0/1

* re-documenting

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Mark Baillie <bailliem@gmail.com>
Co-authored-by: shaesen2 <shaesen2@its.jnj.com>

* Update test-Surv_CNSR.R (#410)

* fix issues associated with this function

* issue fix

* Add @nord to internal functions. (#412)

Add questioning to functions under development / review

* Added test for case when not all colours are defined.

* Tiny bugfix, two more tests

* Update testing of theming

* Updated code/testing for coverage

* Include legend title testing

* Knit readme
Move lifecycle badges to under description
Add questioning badge to tabelone

* add update to news,md

* styler + spell check (#414)

* Update pull_request_template.md

Co-authored-by: Tim Treis <tim.treis@outlook.de>
Co-authored-by: James Black <james@epijim.uk>
Co-authored-by: shaesen2 <haesendonckx.steven@gmail.com>
Co-authored-by: Tim Treis <tim.treis@stud.uni-heidelberg.de>
Co-authored-by: shaesen2 <shaesen2@its.jnj.com>
Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Steven Haesendonckx <47894155+SHAESEN2@users.noreply.github.com>
Co-authored-by: Mark Baillie <bailliem@gmail.com>
Co-authored-by: Joana M. Barros <94060211+joanacmbarros@users.noreply.github.com>
Co-authored-by: ardeeshany <ardeeshany@gmail.com>
  • Loading branch information
11 people authored Jun 22, 2022
1 parent 469f940 commit af91910
Show file tree
Hide file tree
Showing 160 changed files with 14,582 additions and 5,810 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
^README\.md$
^CRAN-RELEASE$
^cran-comments\.md$
^tests/testthat/_snaps$
1 change: 0 additions & 1 deletion .github/CONTRIBUTING.md

This file was deleted.

87 changes: 87 additions & 0 deletions .github/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Contributing to visR

For more detailed info about contributing, please see the
[**development contributing guide**](https://rstd.io/tidy-contrib).

## Fixing typos

You can fix typos, spelling mistakes, or grammatical errors in the documentation directly using the GitHub web interface, as long as the changes are made in the _source_ file.
This generally means you'll need to edit [roxygen2 comments](https://roxygen2.r-lib.org/articles/roxygen2.html) in an `.R`, not a `.Rd` file.
You can find the `.R` file that generates the `.Rd` by reading the comment in the first line.

## Bigger changes

If you want to make a bigger contribution, it's a good idea to first file an issue and make sure someone from the team agrees that it’s needed.
If you’ve found a bug, please file an issue that illustrates the bug with a minimal
[reprex](https://www.tidyverse.org/help/#reprex) (this will also help you write a unit test, if needed).

### Pull request process

* Fork the package and clone onto your computer. If you haven't done this before, we recommend using `usethis::create_from_github("openpharma/visR", fork = TRUE)`.

* Install all development dependencies with `devtools::install_dev_deps()`, and then make sure the package passes R CMD check by running `devtools::check()`. If R CMD check doesn't pass cleanly, it's a good idea to ask for help before continuing.

* Create a Git branch for your pull request (PR). We recommend using `usethis::pr_init("brief-description-of-change")`.

* Make your changes, commit to git, and then create a PR by running `usethis::pr_push()`, and following the prompts in your browser.
The title of your PR should briefly describe the change.
The body of your PR should contain `Fixes #issue-number`.

* For user-facing changes, add a bullet to the top of `NEWS.md` (i.e. just below the first header). Follow the style described in <https://style.tidyverse.org/news.html>.

## Code style

### General coding principles

* All new functions should preferably be built using the widely adapted tidyverse (please see namespace for allowed package dependencies).
Dependencies should be kept to a minimum. Please don't restyle code that has nothing to do with your PR.

* Use [roxygen2](https://cran.r-project.org/package=roxygen2), with [Markdown syntax](https://cran.r-project.org/web/packages/roxygen2/vignettes/rd-formatting.html), for updating and creating documentation.

* Use [testthat](https://cran.r-project.org/package=testthat) for unit tests.
Contributions should be accompanied by extensive user acceptance testing. Please reach out to the team if you need help.

* CRAN requires us to use TRUE/FALSE, so don't use T/F.

* Subset using '[[' rather than '$' to avoid surprises with partial matching

### Data Manipulation

* Data is expected to be present in tidy form (one row per observation) unless otherwise noted. Dataframes, rather than tibbles should be returned by functions.

* The magrittr pipe (%>%) can be used for consecutive operations on the the data.

* For models the broom package easily converts key information about the models into tidy data tibbles for subsequent wrangling and visualisation. Note that the implemented methods are lazy and only extract key information, used in most common downstream processing. visR has custom tidiers that extract the informtation from model objects into a dataframe so users have all the information required for any downstream processing.

### Figures

* Plotting should be implemented using ggplot2 unless this is not possible.

* Interactivity may be provided using ggplotly or - if needed plotly or other packages.

### Tables

* Tables should always be also available as raw dataframes.

## Testing

* Write tests as soon as the function is in a somewhat usable state. Improving is easier than starting.

* Add a new test for every issue/bug that is identified.

* Use vdiffr for comparison of anything plotted against a library of manually curated plots.

* Educate over break: Rather than just stopping if parameters have been provided that don't make sense, like shape = NULL, warn the user that this a required argument and set it to a reasonable default.

## Package maintenance
We have integrated several "watchdogs" into our testing routine to ensure adherence to certain standards that we've set. Those routines scan our codebase for possible style violations:

### CRAN watchdog
For a successful submission to CRAN, certain rules have been set in place by the CRAN team, as for example the usage of TRUE/FALSE over T/F. To continuously ensure compliance with those, our CRAN watchdog scans the respective files for violations of those.

### Validation watchdog (in PR)
We want to make it easy to use our package in a more stringent environment that might require all packages to be validated. Based on discussions and similar projects we decided to implement traceability into our testing files. Therefore, both the tests as well as the last change to those, are automatically written into the files for potential scraping. The details on the last change are gathered by usage of git log and then table of contents for the unit test specifications are generated based off of the strings in the actual tests.

## Code of Conduct

Please note that visR project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this project you agree to abide by its terms.
24 changes: 24 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**What changes are proposed in this pull request?**

**Which files are involved in this pull request and what changes were made?**

**Did you include unit tests for the proposed change/bug fix (https://testthat.r-lib.org/)?**

**If there is an GitHub issue associated with this pull request, please provide link.**

--------------------------------------------------------------------------------

Checklist for PR reviewer

- [ ] PR branch has pulled the most recent updates from main branch. Ensure the pull request branch and your local version match and both have the latest updates from the main branch.
- [ ] If a new function was added, function should be included in `_pkgdown.yml`
- [ ] If a bug was fixed, a unit test was added for the bug check
- [ ] Run `pkgdown::build_site()`. Check the R console for errors, and review the rendered website.
- [ ] Code coverage is suitable for any new functions/features. Review coverage with `withr::with_envvar(new = c("NOT_CRAN" = "true"), covr::report())`. Before you run, begin a fresh R session without any packages loaded.
- [ ] R CMD Check runs without errors, warnings, and notes
- [ ] `usethis::use_spell_check()` runs with no spelling errors in documentation
- [ ] Has `NEWS.md` been updated with the changes from this pull request under the heading indicating the latest version. If there is an issue associated with the pull request, reference it in parentheses at the end update (see `NEWS.md` for examples).
- [ ] Has the version number been incremented using `usethis::use_version(which = "dev")`
- [ ] Run `devtools::build_readme()` to build the `README.md` file.
- [ ] Approve Pull Request
- [ ] Merge the PR. Please use "Squash and merge".
54 changes: 54 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
#
# NOTE: This workflow is overkill for most R packages and
# check-standard.yaml is likely a better choice.
# usethis::use_github_action("check-standard") will install it.
on:
push:
branches: [main, master, develop]
pull_request:
branches: [main, master, develop]

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'}
# Use older ubuntu to maximise backward compatibility
- {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-18.04, r: 'release'}
- {os: ubuntu-18.04, r: 'oldrel-1'}
- {os: ubuntu-18.04, r: 'oldrel-2'}
- {os: ubuntu-18.04, r: 'oldrel-3'}
# - {os: ubuntu-18.04, r: 'oldrel-4'} # don't run R v3.4

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2

- 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: rcmdcheck

- uses: r-lib/actions/check-r-package@v2
85 changes: 0 additions & 85 deletions .github/workflows/check-standard.yaml

This file was deleted.

70 changes: 70 additions & 0 deletions .github/workflows/deploy_to_shinyapps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Deploy interactive vignette to visr.shinyapps.io/tte-tutorial/

on:
push:
branches: [ develop ]

workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
# Fails when R=4.1.3
# https://community.rstudio.com/t/error-unhandled-exception-child-task-1049745496-failed-error-building-image-r-version-4-1-2-currently-unavailable/121461/4
r-version: '4.1.2'

- name: Query R dependencies
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
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
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
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Deploy to shinyapps.io
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("learnr")
remotes::install_cran("MatrixModels")
remotes::install_cran("ModelMetrics")
remotes::install_cran("RcppArmadillo")
remotes::install_cran("RcppEigen")
remotes::install_cran("SparseM")
remotes::install_cran("abind")
remotes::install_cran("car")
remotes::install_cran("carData")
remotes::install_cran("caret")
remotes::install_cran("corrplot")
remotes::install_cran("ggpubr")
remotes::install_cran("ggrepel")
remotes::install_cran("ggsci")
remotes::install_cran("ggsignif")
remotes::install_cran("polynom")
remotes::install_cran("rstatix")
remotes::install_cran("visR")
remotes::install_cran("rsconnect")
library('rsconnect');
setAccountInfo(name='visr', token=${{secrets.SHINYAPPS_TOKEN}}, secret=${{secrets.SHINYAPPS_SECRET}})
deployApp(appName = 'tte-tutorial', appDir = 'vignettes/interactive_tte_tutorial')
shell: Rscript {0}
23 changes: 23 additions & 0 deletions .github/workflows/licences.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: License Compliance Check

on:
push:
branches:
- epijim-patch-1
pull_request:
branches: develop

jobs:
license-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: License Report
uses: insightsengineering/r-license-report@main
with:
# R package root path, in case your R package is within a subdirectory of the repo
path: "."
# A regular expression that can be used for matching and flagging non-compliant licenses
regex: "^GPL.*"
# Fail the action if 1 or more matching non-compliant licenses are found
fail: false
1 change: 1 addition & 0 deletions .github/workflows/makedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
install.packages("vdiffr")
install.packages("textshaping", type = "binary")
remotes::install_github("lorenzwalthert/gitsum")
remotes::install_github("pharmaR/riskmetric")
install.packages("ggthemes")
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- 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: pkgdown
needs: website

- name: Deploy package
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
Loading

0 comments on commit af91910

Please sign in to comment.