Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
219 views
in Technique[技术] by (71.8m points)

r - Command Lines error in Rstudio console

how to assign a very long string to a variable in r?

Following works fine

testVar <- "test;test;"  

But the following gives a weird + in the RStudio console.

testVar <- "test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;tes

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

In "An Introduction to R" manual (help.start()), Section 1.8:

Command lines entered at the console are limited to about 4095 bytes (not characters).

[footnote] Some of the consoles will not allow you to enter more, and amongst those which do some will silently discard the excess and some will use it as the start of the next line.

Based on the comments, there does indeed seem to be some variation across consoles in how this is handled. From the OP, we can conclude that RStudio does not allow you to enter more bytes. Currently, RStudio does not acknowledge or intend to address this.

I also found a 2006 conversation in the R devel mailing list where Brian D. Ripley explained the issue and the documentation above. It looks like the limit has changed since then (when it was 1024 bytes).


It's worth noting that it works fine in a sourced script (even when "hard coded"). Only the REPL seems to be at fault.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...