Skip to content

Targets, tar_map, Directories with dates #122

Closed Answered by wlandau
decat7 asked this question in Help
Discussion options

You must be logged in to vote

This is an instance of #94 (comment). You could try substituting expressions instead of the actual data values.

values <- tibble(
  ...,
  date_fun = purrr::map(c("2022-11-04","2022-11-11"), ~rlang::call2("as.Date", .x))
)

It is a requirement that my function arg date_fun be a date data type and not a character.

There are several workarounds in R that may allow you to relax this requirement: for example, a wrapper around make_dataset() that converts a supplied character string to a date before calling make_dataset().

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@decat7
Comment options

Answer selected by decat7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants