Skip to content
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

Warning that R appears to crash when it does not #429

Closed
billdenney opened this issue Nov 29, 2022 · 1 comment
Closed

Warning that R appears to crash when it does not #429

billdenney opened this issue Nov 29, 2022 · 1 comment

Comments

@billdenney
Copy link

When I run the below reprex, it indicates that R appears to have crashed when it did not.

Before running this, you must install the rxode2 and nlmixr2lib packages.

reprex::reprex({
library(nlmixr2lib)
library(rxode2)
modBase <-
  readModelDb("PK_1cmt") %>%
  model(
    cl <- exp(lcl + allo_cl*WT)
  ) %>%
  ini(
    allo_cl <- 0.75
  )

modBase %>%
  addEta("cl")
},
std_out_err = TRUE)

When run manually, this is the result:

> library(nlmixr2lib)
> library(rxode2)
> modBase <-
+   readModelDb("PK_1cmt") %>%
+   model(
+     cl <- exp(lcl + allo_cl*WT)
+   ) %>%
+   ini(
+     allo_cl <- 0.75
+   )
ℹ add covariate `allo_cl`
ℹ add covariate `WT`
ℹ promote `allo_cl` to population parameter with initial estimate 0.75
ℹ change initial estimate of `allo_cl` to `0.75`
> modBase %>%
+   addEta("cl")
ℹ parameter labels from comments are typically ignored in non-interactive mode
ℹ Need to run with the source intact to parse comments
rxode2 model syntax error:
================================================================================
:001: ka <- exp(lka)

rxode2 syntax error after '���o':
:002: cl + etacl <- exp(lcl + allo_cl * WT)
         ^
:002: vc <- exp(lvc)
:003: cp <- linCmt()
================================================================================
Error in rxModelVars_(obj) : Evaluation error: Evaluation error: rxode2 syntax error after '���o':
:002: cl + etacl <- exp(lcl + allo_cl * WT)   ^
more errors could be listed above..
> 

I assume that this has something to do with the unprintable characters.

@hadley
Copy link
Member

hadley commented Nov 22, 2023

This now seems fine, likely due to the fix in rxode2parse.

@hadley hadley closed this as completed Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants