Grokbase Groups R r-help October 2015
Another good reason for using "source" instead of copy/paste is that if an
error occurs, the 'sourced' script will stop at the error, while the
copy/paste will keep on chugging away, knowing who does what in the rest of
the script. Most of the editors I have used on Windows (notepad++, tinn-r)
support highlighting code and then automatically creating a temporary file
that is 'sourced' in.

Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.

On Thu, Oct 29, 2015 at 2:13 PM, Victor Tian wrote:

Thanks, Marc and Jeff, for the advice of running a file of R code rather
than a chunk of R code.

Just thought it would be nice to have a feature like this so that there's
still a sense of interaction in running R code.

It was a random idea and I think using "source" would achieve the same


On Thu, Oct 29, 2015 at 11:51 AM, Jeff Newmiller <jdnewmil at
I highly recommend ?source.

You can use source("clipboard") on windows, but creating complete files
that define functions and feeding those complete files to source is a
significant step in developing reproducible analyses. Whenever you find
yourself pasting more than a couple of lines (one or two function calls)
you should be making another function. However, even if you resist making
functions you should be making a habit of sourcing complete files from disk
rather than passing large chunks of code.
Jeff Newmiller The ..... ..... Go Live...
DCN:<> Basics: ##.#. ##.#. Live
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#.

Sent from my phone. Please excuse my brevity.

On October 29, 2015 8:16:17 AM MST, Victor Tian <>
Hi there,

Often times, I would run R in the terminal when the task is
intensive and a nice-looking UI is less desired.

However, pasting a large chunk of code into the terminal often times
up being messed up. In Python, the same problem would happen, however,
iPython provides a small functionality called magic word such as %paste
that can help paste the code neatly into the terminal.

I'm wondering if there's a similar functionality in R.


*Xu Tian*

[[alternative HTML version deleted]]

R-help at mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.

  [[alternative HTML version deleted]]

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 8 | next ›
Discussion Overview
groupr-help @
postedOct 29, '15 at 3:16p
activeOct 29, '15 at 7:58p



site design / logo © 2018 Grokbase