-
Notifications
You must be signed in to change notification settings - Fork 7
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
External variable in logisticCoefs
call not recognized when inside function call
#220
Comments
Thanks for reaching out. Yes - you've found a bug that we need to fix related to the double-dot notation. Currently, that variable only gets evaulated if it exists in the "root" environment. So, when you create beta_x_m inside the function, the double dot functionality does not find it - it is looking for it in the calling environment. So, a workaround until we fix this is to define beta_x_m just before calling f2(), like this:
Created on 2024-03-23 with reprex v2.1.0 You can do this with replications. Here is an example with 3 replications where beta_x_m is set to 1.5:
Created on 2024-03-23 with reprex v2.1.0 I'll let you know when we've fixed the bigger issue. |
Just to follow up - this bug is related specifically to function
Created on 2024-03-23 with reprex v2.1.0 |
@assignUser I see the problem - in the |
@assignUser I think I see a possible solution: the |
Yeah that sounds like it would work, I can look over the issue in a bit too! |
I've pretty much got it working - will incorporate into |
Oh great, feel free to ping me for a review. I had to reset my dev environment (thanks windows...) |
This has been fixed - install from development. (No need for workaround provided above.) |
That's quick, superb. Thanks! |
First of all, thank you for providing an R package that makes it trivial to simulate some data with a certain marginal probability. Much appreciated.
I'm running into an issue with
logisticCoefs
when simulating p(x) p(m|x) p(y|x,m). I want to define the strength of the effect of x on m on the fly, but I can only get it to work outside of a function call. The variable that sets the strength of the effect is not recognized inside the function call. See the reprex below.Any pointers to what's going wrong?
Thank you.
The text was updated successfully, but these errors were encountered: