Closed ellessenne closed 6 years ago
Alessandro,
Does this work with the version on GitHub? I need to push a new version to CRAN...
-- Mark
On 05/29/2018 01:41 PM, Alessandro Gasparini wrote:
Hello! I was replicating one of the examples from the vignette on predictnl that you sent me, and I couldn't reproduce the example with the linear regression model:
library(rstpm2)
set.seed(123456) x1 <- rnorm(1000) y <- rnorm(1000, x1) fit <- lm(y ~ x1) invert <- function(object, newdata) { thetahat <- coef(object) (newdata$y - thetahat[1])/thetahat[2] } predictnl(fit, invert, newdata = data.frame(y = seq(0, 2, by = 0.5)))
I was expecting the predictnl.default method to be dispatched by default, but that did not happen. However, if I call it directly (and via the ::: operator - is it not exported on purpose?) if works fine:
rstpm2:::predictnl.default(fit, invert, newdata = data.frame(y = seq(0, 2, by = 0.5)))
Should this be useful, my R session info follows:
devtools::session_info()
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/mclements/rstpm2/issues/8, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAiBCW19xRqogs_NnAG79tA8wtBimoM1ks5t3TPIgaJpZM4URVEt.
My bad, it works flawlessly using the version from the develop
branch. Thanks!
Hello! I was replicating one of the examples from the vignette on
predictnl
that you sent me, and I couldn't reproduce the example with the linear regression model:I was expecting the
predictnl.default
method to be dispatched by default, but that did not happen. However, if I call it directly (and via the:::
operator - is it not exported on purpose?) if works fine:Should this be useful, my R session info follows: