Skip to content

[help] Chained targets / branching a branch #1511

Answered by gustavo-tm
gustavo-tm asked this question in Help
Discussion options

You must be logged in to vote

I ended up using memoise() on my functions and ran dynamic branches as normal. It worked. The only issue is that it either consumes a lot of RAM or I memoise it on my hard drive, effectively saving a "target" outside targets.

Maybe this could be implemented on targets? Having an option to memoise some function, then targets would only have to check if that function was ever ran with those specific inputs and reuse the output of that target

Reprex

library(targets)
library(tarchetypes)
library(tidyverse)
library(memoise)

fA <- function(dado, number){
  dado |> mutate(a = number)
}
fB <- function(dado, number){
  dado |> mutate(b = number)
} 
fC <- function(dado, number){  
  dado |> mutate(c 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gustavo-tm
Comment options

Answer selected by gustavo-tm
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