[R] copying huge strings via clipboard?

Carl Witthoft c@r| @end|ng |rom w|ttho|t@com
Fri Mar 4 17:45:39 CET 2022

This is on Windows10 via the R gui  .  I, admittedly inadvisably, tried 
to create a new character object by first copying a 1-million character 
string (including lead and trail "'" chars) to the clipboard and then, 
in the console,

 >> foo <-
and hitting "paste"

What I found is that, around 5000 characters, a newline ( "\n") char 
showed up.  Is this something that the Windows Clipboard does, or 
something odd about pasting into a command in R?

Postscript:  using

 >>  bar <- readChar('thefile.txt',1e6)

the import works perfectly.

Carl Witthoft
personal: carl using witthoft.com
The Witthoft Group, Consulting

More information about the R-help mailing list