[R] How to make own function load automatically on startup

Jonas Malmros jonas.malmros at gmail.com
Sat Oct 27 18:02:47 CEST 2007


Dear list members,

I have written a function, called say Analysis. I supply an Excel file
name as an argument, it does analysis on this file and returns a pdf
file with specific plots, and a text file with several statistical
models' output (I extract certain values from the output and create my
own custom dataframe with output).

As of now I have to open the script file and load the function by hand
every time I start R. I want to make it load automatically into the
environment when I start R. How can I make this happen?

Also, is there a simple way to combine plots and my custom dataframe
with model output in one pdf file? I do use LaTeX, but my collegues
who want to run this function as well do not know what LaTeX is. So I
wonder if I can avoid LaTeX when creating this combined PDF file?
(Avoid in the sense that one does not have to fiddle with LaTeX
itself).

Finally, another small question.
My code contains following snippet: "xlsReadWrite::read.xls", this is
because another package I load masks read.xls function and :: help me
to select correct read.xls. I guessed this use of :: but I would
really like to know what :: is and where can I read more about this
function?

Thank you very much in advance for your time and help!

-- 
Jonas Malmros
Stockholm University
Stockholm, Sweden



More information about the R-help mailing list