diff --git a/DESCRIPTION b/DESCRIPTION index 7edb315..77d511c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: projecttemplates Title: Project Templates for Reproducible Research and Analyses -Version: 0.5.5 +Version: 0.5.6 Authors@R: person(given = "Jasen", family = "Finch", diff --git a/NEWS.md b/NEWS.md index de6a977..28cdd1c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,11 @@ +# projecttemplates 0.5.6 + +* `.dockerignore` file is now added to output project to ignore the `_targets` directory if present. + +* Target build time and object size are now added to the output pipeline graph in `run.R`. + +* `targets` package options set by `tar_options_set()` now moved to `utils.R`. + # projecttemplates 0.5.5 * Fixed the use of user `renv` settings during initialisation to ensure that the user cache is used. diff --git a/R/docker.R b/R/docker.R index 9b02ad0..3039c21 100644 --- a/R/docker.R +++ b/R/docker.R @@ -84,4 +84,7 @@ docker run -v $(pwd):/home/{project_name_directory} {str_to_lower(project_name_d ``` ") %>% write(file = str_c(project_directory,'/README.md'),append = TRUE) + + '_targets' %>% + write(file = str_c(project_directory,'/.dockerignore')) } \ No newline at end of file diff --git a/R/targets.R b/R/targets.R index b7b24e4..1f58701 100644 --- a/R/targets.R +++ b/R/targets.R @@ -58,11 +58,8 @@ targetsScript <- function(project_directory,type = projectTypes()){ source("R/utils.R") "R/functions/" %>% - list.files(full.names = T) %>% + list.files(full.names = TRUE) %>% walk(source) - -tar_option_set(error = "continue") - ') writeLines(template,str_c(project_directory,'_targets.R',sep = '/')) @@ -159,7 +156,7 @@ targetsRun <- function(project_directory,renv = TRUE){ {restore} targets::tar_make() -pipeline_graph <- targets::tar_visnetwork() +pipeline_graph <- targets::tar_visnetwork(label = c("time", "size")) visNetwork::visSave(pipeline_graph, file = "exports/pipeline_graph.html") ') diff --git a/R/utils.R b/R/utils.R index 0ecb15a..8f65b62 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1,5 +1,5 @@ -#' Add R package loading utilities -#' @description Add package utilites to a project directory. +#' Add R package settings +#' @description Add package utilities to a project directory such as package loading and settings. #' @param project_directory the project directory file path #' @param cran character vector of cran R package dependencies #' @param bioc character vector of bioconductor R package dependencies @@ -52,6 +52,9 @@ utils <- function(project_directory = '.', ## Resolve conflicts # conflict_prefer(quiet = TRUE) +## Targets options +tar_option_set(error = "continue") + ') writeLines(script,glue('{project_directory}/utils.R')) } diff --git a/README.md b/README.md index 5fa72ea..0b22777 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ # projecttemplates + +[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) [![R build status](https://github.com/jasenfinch/projecttemplates/workflows/R-CMD-check/badge.svg)](https://github.com/jasenfinch/projecttemplates/actions) [![Codecov test coverage](https://codecov.io/gh/jasenfinch/projecttemplates/branch/master/graph/badge.svg)](https://codecov.io/gh/jasenfinch/projecttemplates?branch=master) [![license](https://img.shields.io/badge/license-GNU%20GPL%20v3.0-blue.svg)](https://github.com/jasenfinch/projecttemplates/blob/master/DESCRIPTION) [![GitHub release](https://img.shields.io/github/release/jasenfinch/projecttemplates.svg)](https://GitHub.com/jasenfinch/projecttemplates/releases/) + Quick and simple generation of [targets](https://docs.ropensci.org/targets/) and [renv](https://rstudio.github.io/renv/index.html) powered project templates for reproducible research and analyses. diff --git a/docs/404.html b/docs/404.html index 1596d8a..9bde632 100644 --- a/docs/404.html +++ b/docs/404.html @@ -71,7 +71,7 @@
diff --git a/docs/LICENSE.html b/docs/LICENSE.html index e265730..d36b3b7 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -71,7 +71,7 @@ diff --git a/docs/authors.html b/docs/authors.html index 05c5d5d..83a8900 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -71,7 +71,7 @@ diff --git a/docs/index.html b/docs/index.html index 0b56e1b..dc31a28 100644 --- a/docs/index.html +++ b/docs/index.html @@ -31,7 +31,7 @@ @@ -72,6 +72,7 @@Quick and simple generation of targets and renv powered project templates for reproducible research and analyses.
+.dockerignore
file is now added to output project to ignore the _targets
directory if present.
Target build time and object size are now added to the output pipeline graph in run.R
.
targets
package options set by tar_options_set()
now moved to utils.R
.
Add R package loading utilities
Add R package settings
Add package utilites to a project directory.
+Add package utilities to a project directory such as package loading and settings.
utils( diff --git a/man/utils.Rd b/man/utils.Rd index b0bc26f..6a25cd2 100644 --- a/man/utils.Rd +++ b/man/utils.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/utils.R \name{utils} \alias{utils} -\title{Add R package loading utilities} +\title{Add R package settings} \usage{ utils( project_directory = ".", @@ -24,7 +24,7 @@ utils( \item{install}{value to set install argument of `pacman` package loading functions} } \description{ -Add package utilites to a project directory. +Add package utilities to a project directory such as package loading and settings. } \examples{ \dontrun{