Re: [R] How to source a part of the file

2011-03-13 Thread Paul Y. Peng
2011 at 11:56 PM, Gabor Grothendieck < ggrothendi...@gmail.com> wrote: > On Sun, Mar 13, 2011 at 11:32 PM, Paul Y. Peng wrote: > > Many thanks to Jim Holtman and Gabor Grothendieck for your quick > responses. > > Jim's solution works beautifully for my tasks. Thanks. I

Re: [R] How to source a part of the file

2011-03-13 Thread Paul Y. Peng
11, 2011 at 4:53 PM, jim holtman wrote: > > You can do: > > > > source(readLines(yourFile)[10:20]) # lines 10-20 of the file > > > > On Fri, Mar 11, 2011 at 4:41 PM, Paul Y. Peng wrote: > >> I have a text file of R commands. Some times I only want to run a

[R] How to source a part of the file

2011-03-11 Thread Paul Y. Peng
I have a text file of R commands. Some times I only want to run a few lines of the R commands in an existing R session and wonder whether there is a simple way to do this. To run a few lines in a new session of R, I could use sed to pick up the lines from the file and pipe them into R. source() d