Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in documentation for tar_combine?? #206

Closed
weberse2 opened this issue Dec 4, 2024 · 2 comments
Closed

bug in documentation for tar_combine?? #206

weberse2 opened this issue Dec 4, 2024 · 2 comments
Assignees

Comments

@weberse2
Copy link

weberse2 commented Dec 4, 2024

The documentation example for tar_combine is:

if (identical(Sys.getenv("TAR_LONG_EXAMPLES"), "true")) {
targets::tar_dir({ # tar_dir() runs code from a temporary directory.
targets::tar_script({
  library(tarchetypes)
  target1 <- tar_target(x, head(mtcars))
  target2 <- tar_target(y, tail(mtcars))
  target3 <- tar_combine(
    name = new_target_name,
    target1,
    target2,
    command = bind_rows(!!!.x)
  )
  target4 <- tar_combine(
    name = "new_target_name2",
    target1,
    target2,
    command = quote(bind_rows(!!!.x))
  )
  list(target1, target2, target3, target4)
})
targets::tar_manifest()
})
}

I am confused about the target4 which does not use tar_combine_raw while the command is being quoted? Do I misunderstand here something or should target4 be defined by tar_combine_raw?

@wlandau
Copy link
Member

wlandau commented Dec 4, 2024

Yes, the documentation was wrong. Should be fixed now.

@weberse2
Copy link
Author

weberse2 commented Dec 5, 2024

Thanks for the quick turnaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants