Contents

library(rworkflows)

1 GitHub Secrets

Before pushing changes to your new R package, you will need to set up one or more GitHub Secrets:

2 use_workflow

2.1 dynamic action

User only have to run use_workflow once per R package to create a workflow file that calls the rworkflows action.

workflow <- rworkflows::use_workflow(run_bioccheck = FALSE, 
                                     run_rcmdcheck = TRUE,  
                                     run_pkgdown = TRUE, 
                                     run_docker = TRUE,
                                     docker_user = "bschilder",
                                     docker_org = "neurogenomicslab",
                                     ## Use default save_dir in practice
                                     save_dir = tempdir())
## Saving workflow ==> /var/folders/zq/h7mtybc533b1qzkys_ttgpth0000gn/T//Rtmp3K3j0K/rworkflows.yml

2.2 static workflow

Alternatively, you may use

workflow_static <- rworkflows::use_workflow(name = "rworkflows_static",
                                     run_bioccheck = FALSE, 
                                     run_rcmdcheck = TRUE,  
                                     run_pkgdown = TRUE, 
                                     run_docker = TRUE,
                                     docker_user = "bschilder",
                                     docker_org = "neurogenomicslab",
                                     ## Use default save_dir in practice
                                     save_dir = tempdir())
## Saving workflow ==> /var/folders/zq/h7mtybc533b1qzkys_ttgpth0000gn/T//Rtmp3K3j0K/rworkflows_static.yml

3 use_badges

This function creates a banner containing badges, a hex sticker (if one is available), and author names.

badges <- rworkflows::use_badges()
## Adding version.
## Adding actions.
## Adding commit.
## Adding code size
## Adding codecov.
## Adding license.
## Adding authors.




R build status License: GPL-3

Authors: Brian Schilder, Alan Murphy, Nathan Skene

4 use_dockerfile

Create a Dockerfile that installs your R package and all its Imports/Suggests. It is normally not necessary for users to run this function themselves unless they would like to use it to create a template Dockerfile and then customise it further (rather than creating one on the fly).

## Use default save_dir in practice
dockerfile <- rworkflows::use_dockerfile(save_dir = tempdir()) 
## Creating new Docker file ==> /var/folders/zq/h7mtybc533b1qzkys_ttgpth0000gn/T//Rtmp3K3j0K/Dockerfile

5 Templates

You can generate templates for each of the following R package elements. These templates are designed to dynamically autofill as as much information as possible (package name, date, authors) to minimise manual editing steps and ensure documentation is as up-to-date as possible.

5.1 README

README rmarkdown file. Allows you to run code inside to generate a README markdown file.

## Use default save_dir in practice
readme <- rworkflows::use_readme(save_dir = tempdir())
## Creating new README file ==> /var/folders/zq/h7mtybc533b1qzkys_ttgpth0000gn/T//Rtmp3K3j0K/README.Rmd
## Warning in file.copy(from = template_path, to = path, overwrite = TRUE, :
## 'recursive' will be ignored as 'to' is not a single existing directory

5.2 Vignette: Get started

Generate a vignette on how to get started with your R package. Requires additional editing to fill in examples.

## Use default save_dir in practice
vignette1 <- rworkflows::use_vignette_getstarted(package = "mypackage",
                                                 save_dir = tempdir())
## Creating new vignette file ==> /var/folders/zq/h7mtybc533b1qzkys_ttgpth0000gn/T//Rtmp3K3j0K/vignettes/mypackage.Rmd

5.3 Vignette: docker

Generate a vignette on how to install your R package via with your R package, RStudio, and all dependencies already installed. This vignette does not require any manual editing after creation (unless you want to change things like port number, for example).

Note, this is only relevant when you have a Dockerhub repo for your R package, e.g. created with:

rworkflows::use_workflow(run_docker = TRUE, 
                         docker_org = "<docker_org>")
## Use default save_dir in practice
vignette2 <- rworkflows::use_vignette_docker(docker_org = "neurogenomicslab",
                                             save_dir = tempdir())
## Creating new vignette file ==> /var/folders/zq/h7mtybc533b1qzkys_ttgpth0000gn/T//Rtmp3K3j0K/vignettes/docker.Rmd

6 Session Info

utils::sessionInfo()
## R version 4.2.1 (2022-06-23)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Big Sur ... 10.16
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] C/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] rworkflows_0.99.5 data.table_1.14.6 BiocStyle_2.26.0 
## 
## loaded via a namespace (and not attached):
##  [1] bslib_0.4.2         compiler_4.2.1      pillar_1.8.1       
##  [4] BiocManager_1.30.19 RColorBrewer_1.1-3  jquerylib_0.1.4    
##  [7] yulab.utils_0.0.6   tools_4.2.1         digest_0.6.31      
## [10] jsonlite_1.8.4      evaluate_0.19       lifecycle_1.0.3    
## [13] tibble_3.1.8        gtable_0.3.1        pkgconfig_2.0.3    
## [16] rlang_1.0.6         DBI_1.1.3           cli_3.5.0          
## [19] rvcheck_0.2.1       yaml_2.3.6          xfun_0.36          
## [22] fastmap_1.1.0       dplyr_1.0.10        stringr_1.5.0      
## [25] knitr_1.41          desc_1.4.2          generics_0.1.3     
## [28] vctrs_0.5.1         sass_0.4.4          dlstats_0.1.6      
## [31] rprojroot_2.0.3     tidyselect_1.2.0    grid_4.2.1         
## [34] here_1.0.1          glue_1.6.2          R6_2.5.1           
## [37] fansi_1.0.3         rmarkdown_2.19      bookdown_0.31      
## [40] ggplot2_3.4.0       badger_0.2.2        magrittr_2.0.3     
## [43] scales_1.2.1        htmltools_0.5.4     assertthat_0.2.1   
## [46] colorspace_2.0-3    utf8_1.2.2          stringi_1.7.8      
## [49] munsell_0.5.0       cachem_1.0.6