Re: [R] R newbie example code question

From: Adrian DUSA <dusa.adrian_at_gmail.com>
Date: Sun 15 Jan 2006 - 04:47:19 EST

 <Ted.Harding <at> nessie.mcc.ac.uk> writes:
> [...]
> The solution I finally opted for, and still use,
> is based (in a Linux environment) on including
> the following code in your .Rprofile file:
>
> .xthelp <- function() {
> tdir <- tempdir()
> pgr <- paste(tdir, "/pgr", sep="")
> con <- file(pgr, "w")
> cat("#! /bin/bash\n", file=con)
> cat("export HLPFIL=`mktemp ", tdir, "/R_hlp.XXXXXX`\n",
> sep="", file=con)
> cat("cat > $HLPFIL\nxterm -e less $HLPFIL &\n", file=con)
> close(con)
> system(paste("chmod 755 ", pgr, sep=""))
> options(pager=pgr)
> }
> .xthelp()
> rm(.xthelp)
>
> (and it's also specific to the 'bash' shell because
> of the "#! /bin/bash\n", but you should be able to
> change this appropriately). The above was posted by
> Roger Bivand on 27 May.
> [...]

I also like the function, it's beautiful. I wonder if anyone could help me with the correct syntax for my bash shell (I assume this is the problem) because I get this error:

Error in rm(.xthelp) : cannot remove variables from base namespace

when starting R and when installing a new package. Thank you,
Adrian



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 Received on Sun Jan 15 04:54:31 2006

This archive was generated by hypermail 2.1.8 : Sun 15 Jan 2006 - 06:21:12 EST