stan-dev / stan-dev/rstan

can't read https model file -rats-fit sample

Open
#996 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
1.1k
Forks
266
Avg merge
2h 56m
Merged PRs (30d)
1

Description

Summary:

stan(file=,...) can't read https link

Reproducible Steps:

run sample:
y <- as.matrix(read.table('https://raw.github.com/wiki/stan-dev/rstan/rats.txt', header = TRUE))
x <- c(8, 15, 22, 29, 36)
xbar <- mean(x)
N <- nrow(y)
T <- ncol(y)
rats_fit <- stan(file='https://raw.githubusercontent.com/stan-dev/example-models/master/bugs_examples/vol1/rats/rats.stan', data = list(N=N, T=T, y=y, x=x, xbar=xbar))

got error message:
Error in file(fname, "rt") : cannot open the connection
In addition: Warning messages:
1: In normalizePath(path.expand(path), winslash, mustWork) :
path[1]="https://raw.githubusercontent.com/stan-dev/example-models/master/bugs_examples/vol1/rats/rats.stan": The filename, directory name, or volume label syntax is incorrect
2: In file(fname, "rt") :
cannot open file 'G:\Source\Repos\R\R4DS\https:\raw.githubusercontent.com\stan-dev\example-models\master\bugs_examples\vol1\rats\rats.stan': Invalid argument
Error in get_model_strcode(file, model_code) :
cannot open model file "G:\Source\Repos\R\R4DS\https:\raw.githubusercontent.com\stan-dev\example-models\master\bugs_examples\vol1\rats\rats.stan"

RStan Version:

The version of RStan you are running 2.26.8

R Version:

The version of R you are running 4.1.3

Operating System:

Your operating system Windows 10 2021H2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure using the reported stan(file=...) call and the HTTPS rats.stan URL, then start at get_model_strcode, which reports the model-file error. Done means the HTTPS model file is accepted on the reported RStan and Windows setup while local model-file handling still works; rerun the rats sample to verify it.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.