Avoid R’s 2 GB string limit in read_cmdstan_csv()
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 160
- Forks
- 69
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 15
Description
I am running a model with some out of sample predictions in generated quantities.
When I sample from the model without the out of sample predictions, everything is fine and runs as expected.
When I include the predictions, I get the following error:
Error in data.table::fread(cmd = fread_cmd, select = sampler_diagnostics, :
R character strings are limited to 2^31-1 bytes
Am I correct that this suggests a very long string is being generated somewhere? Is it possible to work around?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at read_cmdstan_csv(), particularly the data.table::fread(cmd=...) call named in the error, and reproduce the failure with generated quantities containing out-of-sample predictions. Trace how the sampler diagnostics are read and determine what supported handling or workaround is needed for output exceeding R's string limit; done means the reported case no longer fails or has a documented workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100