[R] Assigning functions in Rprofile
Uwe Ligges
ligges at statistik.uni-dortmund.de
Wed Apr 21 08:52:02 CEST 2004
Robert King wrote:
> I use the ugly hack shown below as my .Rprofile (mainly because I couldn't
> find any other way to spawn a new mozilla window on starting R or calling
> help.start(), but then send all the help html documents to that new
> window).
>
> With a recent change from a cvs checkout to the released 1.9.0 I find that
> the new hs() appears if there is nothing of that name in .RData, but if
> there is the old hs() there, it just stays.
>
> What is the cause of this?
Because .Rprofile is loaded before .RData. Hence tho "old" version
overwrites the new one ...
Uwe Ligges
> Thanks,
> Robert.
>
> I'm using a debian i386 system.
>
> .Rprofile
> =========
> library(gld)
> options(pager="less",CRAN="ftp://mirror.aarnet.edu.au/pub/cran")
> hs <- function(){
> if (nchar(system("echo $DISPLAY",intern=T))==0) # no X
> {options(htmlhelp=FALSE)
> ret <- "no X"}
> else {system("mozilla") # we have X - I'm starting this to get a new
> # window for the R session, without starting a new window every
> time
> options(pdfviewer="/usr/local/bin/acroread",browser="mozilla")
> help.start()
> ret <- "X"}
> ret
> }
>
>
> ----
> Robert King, Statistics, School of Mathematical & Physical Sciences,
> University of Newcastle, Australia
> Room V133 ph +61 2 4921 5548
> Robert.King at newcastle.edu.au http://maths.newcastle.edu.au/~rking/
>
> He defended the cause of the poor and needy, and so all went well. Is that
> not what it means to know me?" declares the LORD.
> -- Jeremiah 22:16
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
More information about the R-help
mailing list