Replies: 4 comments
-
I probably should have mentioned that I can run the code in the Coal Mining Disasters vignette (https://lindeloev.github.io/mcp/articles/poisson.html) perfectly. |
Beta Was this translation helpful? Give feedback.
-
Thanks for reporting! Perhaps you defined the variable |
Beta Was this translation helpful? Give feedback.
-
If that's not the issue, let's see if we can pinpoint this further. If you open a blank session in R 4.3.1 and run the following in RStudio with mcp 0.3.3, do you get the error? I just installed mcp 0.3.3 in a "fresh" R 4.3.1 on RStudio 2023.06 on Windows 11 and it ran as expected. library(mcp)
# Define the model
model = list(
response ~ 1, # plateau (int_1)
~ 0 + time, # joined slope (time_2) at cp_1
~ 1 + time # disjoined slope (int_3, time_3) at cp_2
)
# Get example data and fit it
ex = mcp_example("demo")
fit = mcp(model, data = ex$data) |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for getting back to me Jonas, and there is absolutely no
cause for apologies! :)
Although I have not yet pinpointed exactly what was wrong that caused my
code to fail, your recommendation to start a blank session showed that
there must have been something in my (rather overloaded) saved RStudio
workspace that was causing a conflict of the type you suggested. When I ran
the code you supplied in that blank session it worked perfectly. Then, when
I re-loaded my own workspace and cleared the environment of all
nonessential variables, it worked perfectly there too.
It seems the good news is that there is no bug in mcp -- only a local
conflict that I created inadvertently myself! I will make a note of this on
GitHub, so it hopefully does not cause any further confusion or waste more
of your time.
Thank you so much, and again, I love the work you have done with mcp!
All the best,
mike
…On Wed, Jul 12, 2023 at 5:05 PM Jonas Kristoffer Lindeløv < ***@***.***> wrote:
Thanks for reporting! Perhaps you defined the variable sd, min, max, or
mean, overwriting the built-in function?
If that's not the issue, let's see if we can pinpoint this further since I
cannot reproduce it. If you open a blank session in R 4.3.1 and run the
following in RStudio with mcp 0.3.3, you get the error?
library(mcp)
# Define the modelmodel = list(
response ~ 1, # plateau (int_1)
~ 0 + time, # joined slope (time_2) at cp_1
~ 1 + time # disjoined slope (int_3, time_3) at cp_2
)
# Get example data and fit itex = mcp_example("demo")fit = mcp(model, data = ex$data)
I just installed mcp 0.3.3 in a "fresh" R 4.3.1 on RStudio 2023.06 on
Windows 11 and it ran as expected.
—
Reply to this email directly, view it on GitHub
<#161 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BA7GQHUKBHMEK5DSANKDGALXP4GR3ANCNFSM6AAAAAAZ233ZXU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I love the concepts embodied in mcp, and have some specific use cases in mind. When trying to run the demos though, I ran into a puzzling issue. When I call
fit = mcp(model, data = ex$data)
as per code cut and pasted from the first Brief Worked Example in the tutorial at https://github.com/lindeloev/mcp I get the error messageThe internal call
func_eval(data[, column], na.rm = TRUE)
can be found in mcp functionR/run_jags.R
(see https://rdrr.io/github/lindeloev/mcp/src/R/run_jags.R), in the code block headed with the commentI am running mcp 0.3.3 on R 4.2.3 in RStudio "Spotted Wakerobin" Release (e7373ef8, 2022-09-06) for Windows, on Windows 10. Thanks for any suggestions!
Beta Was this translation helpful? Give feedback.
All reactions