On 5/28/2013 2:44 AM, Jim Lemon wrote: > On 05/28/2013 04:54 PM, Mark Breman wrote: >> Hello List, >> >> When i paste a large block of R code from an editor to the R command >> line >> the execution of the code will often fail at some point because it is >> not >> pasted as it was copied. >> ... > > Hi Mark, > I have encountered this problem, and it may be due to the following: > > Command lines entered at the console are limited to about 4095 bytes > (not characters). > > From "An Introduction to R", included in the distribution.
From within RGui, the "File" option (upper left menu) offers, "Source R Code", "New Script", "Open Script", ... . I selected "Open Script", then pasted your sample section into that window. Then I highlighted the first three lines and selected Edit -> "Run line or selection Ctrl+R". That caused the selected lines to be run without the "paste" step. Another options is to use ESS (Emacs Speaks Statistics, http://ess.r-project.org <http://ess.r-project.org/>). This has several advantages including an editor that interprets a file opened with a .R extension as R code and adjusts its display to help provide context sensitive indents -- to make it easier to see when you have failed to close a parentheses, coloring comment differently etc. If you use Linux, you may already use Emacs. If so, you only need to learn ESS. There's a separate email list for that. Hope this helps. Spencer > > Jim > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.