Re: [R] How to start R with a file loaded?

From: Grateful Frog <gratefulfrog_at_gmail.com>
Date: Wed 25 Oct 2006 - 20:46:09 GMT

Thanks to all you numerous r-helpers, the problem is solved! It's so much easier when someone explains. I was going crazy trying to understand the manual on my own!

Thanks again to everyone!

GF

On 10/25/06, Pierce, Ken <ken.pierce@oregonstate.edu> wrote:
>
> You can edit the below file which runs during R startup. This is where
> you might put a .First file.
> I have a bunch of functions I've written so I have a line in this file
> that sources my functions file.
> You can also put library commands here to autoload stuff you always
> want.
>
>
> C:\Program Files\R\R-2.3.1\etc\Rprofile.site
>
> ##############Example below
>
> # Things you might want to change
>
> # options(papersize="a4")
> # options(editor="notepad")
> # options(pager="internal")
>
> # to prefer Compiled HTML help
> # options(chmhelp=TRUE)
>
> # to prefer HTML help
> # options(htmlhelp=TRUE)
>
> options(IDE = 'C:/Program files/Tinn-R/bin/Tinn-R.exe')
> options(use.DDE = TRUE)
>
> library(svIDE)
> library(svSocket)
> library(svIO)
> guiDDEInstall()
>
> source("C:\\Rprojects\\functions\\Rfunctions.r")
>
>
> .First <- function(){
> cat("\n Rrrr! The Pirates statistics program!\n\n")
>
> }
>
>
>
>
> -----Original Message-----
> From: r-help-bounces@stat.math.ethz.ch
> [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Grateful Frog
> Sent: Tuesday, October 24, 2006 10:17 AM
> To: r-help@stat.math.ethz.ch
> Subject: [R] How to start R with a file loaded?
>
> Hi!
>
> I've made great progress in my R programming, but I am again stuck on a
> beginner's problem.
>
> I would like to start R with a command line that loads a file, and if
> possible, executes a function.
>
> Can anyone give me an example of how to do this?
>
> For example, in lisp, I would say:
>
> $ lisp -load toto.lisp -eval '(do-something $PORT)'
>
> to load the file "toto.lisp", then evaluate the expression with the
> shell envt variable bound properly.
>
> I'd like to do this in R, but can't figure it out!
>
> Thanks,
> GF.
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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. Received on Thu Oct 26 06:51:15 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 25 Oct 2006 - 21:30:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.