Hello, Thanks to people who responded to previous mail! Is there a way in which we can stop further sourcing of an R file? i.e., i am sourcing an R file and keep an equivalent of 'exit' in it and run the code till that point? Thanks again Regards Ramakrishna
q()> Date: Thu, 13 Nov 2003 13:52:16 -0700 (MST) > From: "U.Ramakrishna" <ramakrsn at CS.ColoState.EDU> > Sender: r-help-bounces at stat.math.ethz.ch > Precedence: list > > Hello, > Thanks to people who responded to previous mail! > > Is there a way in which we can stop further sourcing > of an R file? i.e., i am sourcing an R file and keep > an equivalent of 'exit' in it and run the code till that point? > > Thanks again > Regards > Ramakrishna > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > >-- __________________________________________________ [ ] [ Giovanni Petris GPetris at uark.edu ] [ Department of Mathematical Sciences ] [ University of Arkansas - Fayetteville, AR 72701 ] [ Ph: (479) 575-6324, 575-8630 (fax) ] [ http://definetti.uark.edu/~gpetris/ ] [__________________________________________________]
> Thankyou, but i *donot* want the R session to quit. > Someone suggested writing functions with return kept at > the locations. > I wanted to ask if there was another way. >Just have a single } as your last line, and put: if (FALSE) { just after where you want to stop. Ray Brownrigg
This will source lines up but not including the first line with exit in it: z <- readLines("myfile.r") z <- textConnection(z[seq(grep("exit",z)[[1]]-1)]) source(z) close(z) --- Date: Thu, 13 Nov 2003 13:52:16 -0700 (MST) From: U.Ramakrishna <ramakrsn at CS.ColoState.EDU> To: <r-help at stat.math.ethz.ch> Subject: [R] stop further sourcing of an R file Hello, Thanks to people who responded to previous mail! Is there a way in which we can stop further sourcing of an R file? i.e., i am sourcing an R file and keep an equivalent of 'exit' in it and run the code till that point? Thanks again Regards Ramakrishna
?stop swami *************************************************************************** The contents of this communication are intended only for the addressee and may contain confidential and/or privileged material. If you are not the intended recipient, please do not read, copy, use or disclose this communication and notify the sender. Opinions, conclusions and other information in this communication that do not relate to the official business of my company shall be understood as neither given nor endorsed by it.