You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that in the targets tutorial you make heavy use of roxygen comments for your functions and the folder contains a DESCRIPTION file much like a package. So I was wondering if we could take this a step further (and maybe this is a neat trick to add to the documentation):
If you include a function:
RStudio's build panel and the shortcut Ctrl+Shift+B not only generate the documentation for the functions (which can be viewed in RStudios help panel), it also runs the targets pipeline!
Good thoughts, but the trouble is that tar_vistnetwork(), tar_watch(), etc. need to load the project's functions without running tar_make(). Also, devtools::load_all() has gotchas when it comes to targets workflows. For one, tar_option_get("envir") (the environment where targets looks for global functions and other objects) is the global environment by default, but devtools::load_all() puts these objects in a package environment. In addition, if you call devtools::load_all() in _targets.R, then parallel workers in tar_make_clustermq() and tar_make_future() cannot access the package contents. If you implement a workflow as an R package, it is best to fully install the package and supply it to the packages and imports options as described at https://books.ropensci.org/targets/practices.html#packages-based-invalidation.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I noticed that in the targets tutorial you make heavy use of roxygen comments for your functions and the folder contains a DESCRIPTION file much like a package. So I was wondering if we could take this a step further (and maybe this is a neat trick to add to the documentation):
If you include a function:
RStudio's build panel and the shortcut
Ctrl+Shift+B
not only generate the documentation for the functions (which can be viewed in RStudios help panel), it also runs the targets pipeline!Beta Was this translation helpful? Give feedback.
All reactions