teunbrand,

folks who switched from notebook/rmd/qmd oriented workflows to {targets}, how did you transition? Do you just precompute files with {targets} and then use these in your notebooks? Is rendering a notebook in itself a target? How do you do EDA now versus then?
I find it hard to adapt my analysis mindset to the targets framework

njtierney,
@njtierney@aus.social avatar

@teunbrand I still use notebooks as a scratch/playground within targets. But move all my data reading etc and other tasks into targets. Then you can load them inside a qmd/rmd file and do EDA from there

teunbrand,

@njtierney Right so I/O and other standardisable tasks should stay in targets? How do you deal with 'due diligence' tasks that you investigate but end up not using for your final goal? Just prune your targets in the end or you keep them around somewhere?

milesmcbain,
@milesmcbain@fosstodon.org avatar

@teunbrand @njtierney similar to others I sometimes employ a ./discovery folder where I muck around in scripts or notebooks if I am very uncertain of how to proceed. But usually these are quite short.

Another trick is to create an anonymous function at the bottom of a target function file to work as your ‘scratch pad’. Since it has no binding it never contaminates your environment.

milesmcbain,
@milesmcbain@fosstodon.org avatar

@teunbrand @njtierney once you become fluent in targets you don’t actually like doing much work outside it because you move too slowly. It seems like less work to skip for a quick investigation until you’re stumbling over stale state creating weird results, and wasting time tracking down phantom bugs. So then you’re restarting your R session from scratch numerous times and rerunning your code from scratch and then you swear to yourself just to use targets from the start next time.

milesmcbain,
@milesmcbain@fosstodon.org avatar

@teunbrand @njtierney I made some stuff to help me go faster. You may enjoy: {tflow}, {fnmate}

noamross,
@noamross@ecoevo.social avatar

@milesmcbain @teunbrand @njtierney Whether something is exploratory or in a target, I'm much more likely to write it as a function in R/ (with Miles's {fnmate} as a helper). I tend to end up with a lot of functions that aren't used in the final workflow.

noamross,
@noamross@ecoevo.social avatar

@milesmcbain @teunbrand @njtierney I also usually have notebooks, themselves targets, for data or model diagnostics that load in processed data or built model targets. But if anything will be in an output (in my case usually a report/manuscript figure or table), there's a target for that. I rarely write full literate code documents, but I sometimes have a target called "quantities" that is an Rmd of every numeric value reported in manuscript text.

njtierney,
@njtierney@aus.social avatar

@noamross @milesmcbain @teunbrand Oh quantities sounds a little bit magic, I could see that being super handy!

brodriguesco,
@brodriguesco@fosstodon.org avatar

@teunbrand you might find this chapter of my book helpful: https://raps-with-r.dev/targets.html#targets-and-rmarkdown-or-quarto

(i hope so at least)

teunbrand,

@brodriguesco Ah yes this is helpful for grasping the outline of it. So: yes, you precompute files and yes rendering a notebook is in itself a target. So let's say you try 3 approaches to a problem and find a satisfactory one, you just end up with 2-leaf nodes in targets instead of letting them die in the notebook?

brodriguesco,
@brodriguesco@fosstodon.org avatar

@teunbrand I'd only leave the final approach in the workflow

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • mdbf
  • ngwrru68w68
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • osvaldo12
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • InstantRegret
  • tacticalgear
  • provamag3
  • ethstaker
  • cisconetworking
  • modclub
  • tester
  • GTA5RPClips
  • cubers
  • everett
  • normalnudes
  • megavids
  • Leos
  • anitta
  • JUstTest
  • lostlight
  • All magazines