Today I found that R cannot properly accept a string containing 4093 or more characters. I have encountered related problems many times before, but I always thought it's because there are some escape characters in the string (turns out it's not). Is this a bug? #RStats
1
2
1
Replying to @zenggyu
It is more complicated as `paste0(rep('a', 5000), collapse="")` easily creates a longer one. What you found is an (arbitrary but high) limit on a (single) input line in the REPL. If this really mattered to you could probably recompile with a larger constant. #rstats

Sep 16, 2021 · 2:20 AM UTC

2
2
17
Replying to @eddelbuettel
Thanks for your reply! Now I know how to solve some related problems. However, just wondering if R should raise an error in this case if removing the limit is not appropriate?
3
Just did a quick test and it seems that python does not have this limit or the limit is very high (100k characters a line works OK).
I also feel like I've pasted much larger strings in my own R terminal...
1