Error in readRDS(file.rds) : unknown input format



Hi. I install rstan package and faced with this error:

Error in readRDS(file.rds) : unknown input format

please help me,


> traceback()
5: readRDS(file.rds)
4: is(obj <- readRDS(file.rds), "stanmodel")
3: stan_model(file, model_name = model_name, model_code = model_code,
stanc_ret = NULL, boost_lib = boost_lib, eigen_lib = eigen_lib,
save_dso = save_dso, verbose = verbose)
2: stan(file = fName, data = datalist, init = list(inlist), chains = 1,
iter =, pars = c("f", "tau"), warmup = n.warm, seed = computerID +
1000) at functions.r#131
1: RunModel(11, myT, nu, lambda, rho, BDRi, Pars, computerID,,
n.warm, getwd())

RStan Version:


R Version:

R version 3.4.1 (2017-06-30)

Operating System:

windows 10


How did you try to install rstan?


do you need to try readRDS("file.rds") with quotes?


Was the RDS file created with 2.16.2 or an older version of RStan?


Judging from the traceback, it’s not clear to me whether you directly attempted to create an RDS file or not. I’m not even sure if those error messages come from your own R code or not.

It would help if you gave the exact set of steps that you used.


This was also posted as an issue on GitHub:

@makarov: Please don’t double-post to our channels (this forum, GitHub, StackOverflow, specifically). It diffuses our answers and can lead to us answering the questiont twice and we’re pressed for time as it is.