Skip to content

Commit

Permalink
load package via tar_option_set instead of library
Browse files Browse the repository at this point in the history
To align with books.ropensci.org/targets/walkthrough.html#target-script-file
  • Loading branch information
atusy authored Jul 23, 2021
1 parent 4490149 commit 04512f5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions debugging.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ Workspaces are a persistent alternative to the environment browser. A workspace
# _targets.R file:
options(tidyverse.quiet = TRUE)
library(targets)
library(tidyverse)
options(crayon.enabled = FALSE)
tar_option_set(workspace_on_error = TRUE)
tar_option_set(
packages = "tidyverse",
workspace_on_error = TRUE
)
f <- function(arg, value, ...) {
stopifnot(arg < 4)
}
Expand Down

0 comments on commit 04512f5

Please sign in to comment.