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

Error: package or namespace load failed for ‘rstan’ #1069

Open
connor-morozumi opened this issue May 23, 2023 · 0 comments
Open

Error: package or namespace load failed for ‘rstan’ #1069

connor-morozumi opened this issue May 23, 2023 · 0 comments

Comments

@connor-morozumi
Copy link

Summary:

rstan fails to load due to ggplot, unused argument (linewidth = 1)

Description:

The error

Error: package or namespace load failed for ‘rstan’:
 .onLoad failed in loadNamespace() for 'rstan', details:
  call: ggplot2::element_line(linewidth = 1)
  error: unused argument (linewidth = 1)

I can see this was addressed previously here:
https://github.com/stan-dev/rstan/issues/1062
but can't interpret the advice:

The issue is that the r-ver images use a fixed snapshot of the CRAN repos, which in this case are providing ggplot2 3.3.6. The linewidth aesthetic was introduced in 3.4.0, and so the error.

You'll need to use the same command to install ggplot2 that you did for the renv install

#1062 (comment)

Reproducible Steps:

I was following the Getting Started Guide

when I tried to verify installation by running the test model
example(stan_model, package = "rstan", run.dontrun = TRUE)

library(rstan) causes the same error

Current Output:

Error: package or namespace load failed for ‘rstan’:
.onLoad failed in loadNamespace() for 'rstan', details:
call: ggplot2::element_line(linewidth = 1)
error: unused argument (linewidth = 1)
In addition: Warning message:
package ‘rstan’ was built under R version 4.2.3

Expected Output:

RStan Version:

‘2.26.22’

R Version:

"R version 4.2.0 (2022-04-22)"

Operating System:

OS X 12.3.1

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

1 participant