Re: [R] Saving/loading custom R scripts

2010-09-13 Thread DrCJones
I'm still relatively new to R, so I tried the first of you two solutions: .First <- function(){ source("Friedman-Test-with-Post-Hoc.r.txt") } Thanks very much for that, it works perfectly Cheers -- View this message in context: http://r.789695.n4.nabble.com/Saving-loading-custom-R-scri

Re: [R] Saving/loading custom R scripts

2010-09-09 Thread Joshua Wiley
On Thu, Sep 9, 2010 at 9:28 AM, Jakson A. Aquino wrote: > On Thu, Sep 9, 2010 at 1:14 PM, Joshua Wiley wrote: >> On Thu, Sep 9, 2010 at 7:05 AM, Bos, Roger wrote: >>> Josh, >>> >>> I liked your idea of setting the repo in the .Rprofile file, so I tried it: >>> >>> r <- getOption("repos") >>> r["

Re: [R] Saving/loading custom R scripts

2010-09-09 Thread Jakson A. Aquino
On Thu, Sep 9, 2010 at 1:14 PM, Joshua Wiley wrote: > On Thu, Sep 9, 2010 at 7:05 AM, Bos, Roger wrote: >> Josh, >> >> I liked your idea of setting the repo in the .Rprofile file, so I tried it: >> >> r <- getOption("repos") >> r["CRAN"] <- "http://cran.stat.ucla.edu"; >> options(repos = r) >> rm

Re: [R] Saving/loading custom R scripts

2010-09-09 Thread Joshua Wiley
> > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Joshua Wiley > Sent: Wednesday, September 08, 2010 11:20 AM > To: DrCJones > Cc: r-help@r-project.org > Subject: Re: [R] Saving/loading custom R sc

Re: [R] Saving/loading custom R scripts

2010-09-09 Thread Bos, Roger
8, 2010 11:20 AM To: DrCJones Cc: r-help@r-project.org Subject: Re: [R] Saving/loading custom R scripts Hi, Just create a file called .Rprofile that is located in your working directory (this means you could actually have different ones in each working directory). In that file, you can put in c

Re: [R] Saving/loading custom R scripts

2010-09-08 Thread Peter Ehlers
One comment on the function: I see that it uses T/F instead of TRUE/FALSE in a number of places. You'll save yourself some headaches if you replace those 'T/F's. -Peter Ehlers On 2010-09-08 1:25, DrCJones wrote: Hi, How does R automatically load functions so that they are available from the

Re: [R] Saving/loading custom R scripts

2010-09-08 Thread Bert Gunter
.. Not quite. ?Startup provides details, but note the comment about only the base package being loaded and the need to use somepackage::somefunction() or to explicitly first load a package whose functions are used in .Profile. Note also that .First could also be used instead of putting the code

Re: [R] Saving/loading custom R scripts

2010-09-08 Thread Joshua Wiley
Hi, Just create a file called .Rprofile that is located in your working directory (this means you could actually have different ones in each working directory). In that file, you can put in code just like any other code that would be source()d in. For instance, all my .Rprofile files start with:

Re: [R] Saving/loading custom R scripts

2010-09-08 Thread Abhijit Dasgupta, PhD
You can create a .First function in your .Rprofile file (which will be in ~/.Rprofile). For example .First <- function(){ source("Friedman-Test-with-Post-Hoc.r.txt") } You can also create your own package ("mylibrary") down the line (see the R manual for creating extensions at http://cr

[R] Saving/loading custom R scripts

2010-09-08 Thread DrCJones
Hi, How does R automatically load functions so that they are available from the workspace? Is it anything like Matlab - you just specify a directory path and it finds it? The reason I ask is because I found a really nice script that I would like to use on a regular basis, and it would be nice n