Function always outdated #1366
-
Sorry in advance for a question without a reproducible example. I thought I would check if you have a quick suggestion as to my mistake. I have one target that is always outdated everytime I start a fresh R session. The target looks like this: The function looks as follows:
Its purpose is to simply count the number of "users" of each drug from a dataset of drug users (0/1 = no/yes). I've included a snapshot of the data below. Is there something obviously wrong with the function such that it would always be outdated? I've tried using
|
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 7 replies
-
I am not sure what the issue could be. I assume the error goes away when you try to create a reprex? Could it be that you have an outdated copy of |
Beta Was this translation helpful? Give feedback.
-
I think I may have found the problem, I assume the
I believe the problem was that I was developing and troubleshooting code so had defined some variables within my R session (such as |
Beta Was this translation helpful? Give feedback.
-
So I am trying to set up my I have more than one plan in my project (perhaps this is bad practice?), do I need to include the
In R, I could then interactively run:
Is this the proper use? It's not clear to me how I would only run a single plan. It seems like if I only need to run one plan, it's time consuming to run Thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
Sorry just one another question, I'm just trying to understand the best practices for the workflow. I see that Previously I had a
Using your suggestion, I have bound plans together and then just selected targets with the Should the last 2 lines of the
And then in the interactive session (or a
Plus any other |
Beta Was this translation helpful? Give feedback.
-
Thank-you! I'm still a bit confused. I'm a bit unclear the best way to select different targets unless I am constantly changing the I tried using the
|
Beta Was this translation helpful? Give feedback.
-
Ok got it. Thanks for the explanation. So there isn't really a way around updating the _drake.R file for the different targets/computing requirement each time then? Because previously with my make.R script, I would simply run the make functions with different arguments one after another. Hopefully what I'm trying to do makes sense.
… On Apr 26, 2021, at 18:13, Will Landau ***@***.***> wrote:
The idea is to go through _drake.R to make changes to most arguments. make.R/r_make() will stay the same, which avoids duplication when you update the configuration.
r_fn and r_args control how the external callr process is deployed, and I agree they are probably not relevant here. By default, r_make() launches an external callr::r() process that sources _drake.R and runs the pipeline. r_fn allows you to supply something other than callr::r, such as callr::r_bg, and r_args is a list of named arguments to the callr function.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Beta Was this translation helpful? Give feedback.
-
Got it. It all makes sense. The only reason I have these different make
calls in a separate script is because some of my targets require more cores
than others (we've discussed this previously), and this was the best
workaround I (we) could come up with. But now using the _drake.R script I'm
not sure how best to adapt. The future backend (very, very slow) with
transient workers wasn't a good option and clustermq is much better.
…On Mon, Apr 26, 2021 at 8:02 PM Will Landau ***@***.***> wrote:
Going through _drake.R is part of the design, and targets is similar. In
most cases, this helps avoid having to remember and retype all the
arguments in an interactive call, and it helps manage those arguments
reproducibility. But it's an adjustment for some, I know. targets has a
convenience function tar_edit() that opens _targets.R if you are using
the RStudio IDE.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1366 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AITJSVUVNI24J5J4FTSBWQDTKWTCBANCNFSM43SOW4GA>
.
|
Beta Was this translation helpful? Give feedback.
I think I may have found the problem, I assume the
r_make
may help solve the issue, and ultimately moving totargets
would be the ideal long term solution. Here I have a reproducible example:I believe the problem was that I was developing and troubleshooting code so had defined some variables within my R session (such as
eth
) and the filter function combined with defining this variable invalidated th…