Re: [Rd] require is to suggests as what is to imports?

2010-08-25 Thread Prof Brian Ripley
On Tue, 24 Aug 2010, Dirk Eddelbuettel wrote: On 24 August 2010 at 15:40, Hadley Wickham wrote: | Hi all, | | If a package suggests another package in its description, you can | check it at runtime with requires. How do you do check if a package | is available without loading it, if you only w

Re: [Rd] save() object w/o all of the loaded environment

2010-08-25 Thread Martin Maechler
> "RL" == Roebuck,Paul L > on Tue, 24 Aug 2010 11:06:54 -0500 writes: RL> I have two packages, one that does the actual work (SC) RL> and the other a Tcl/Tk UI (SCUI) that invokes methods RL> within the former. Within the SCUI's invocation method, RL> I save an object

Re: [Rd] require is to suggests as what is to imports?

2010-08-25 Thread Hadley Wickham
On Tue, Aug 24, 2010 at 3:50 PM, Prof Brian Ripley wrote: > On Tue, 24 Aug 2010, Hadley Wickham wrote: > >> Hi all, >> >> If a package suggests another package in its description, you can >> check it at runtime with requires.  How do you do check if a package > > Well, not really as requires() can

Re: [Rd] require is to suggests as what is to imports?

2010-08-25 Thread Hadley Wickham
> But thereby clobber your users with the run-time cost of > installed.packages() (which can take several minutes on some Windows > systems, and just took ca 12secs on my fastest Linux server with 3000 > packages installed).  If you want to take this route (is a package > installed?), see the 'Note

Re: [Rd] require is to suggests as what is to imports?

2010-08-25 Thread Hadley Wickham
On Tue, Aug 24, 2010 at 6:55 PM, Henrik Bengtsson wrote: > isPackageInstalled <- function(package, ...) { >  path <- system.file(package=package); >  (path != ""); > } > > taken from R.utils (which also has a isPackageLoaded()). Nice quick hack (subject to caveats Brian mentions). Thanks! Hadl

Re: [Rd] require is to suggests as what is to imports?

2010-08-25 Thread Dirk Eddelbuettel
On 25 August 2010 at 08:06, Prof Brian Ripley wrote: | On Tue, 24 Aug 2010, Dirk Eddelbuettel wrote: | | > | > On 24 August 2010 at 15:40, Hadley Wickham wrote: | > | Hi all, | > | | > | If a package suggests another package in its description, you can | > | check it at runtime with requires. Ho

[Rd] Trying to configure R to use acml_mp

2010-08-25 Thread szembek
Hi, I'm following up to a post I made to r-help here: http://r.789695.n4.nabble.com/Trouble-configuring-R-to-use-ACML-tt2337193.html#a2337193 I have verified that LD_LIBRARY_PATH is set... I set it in /etc/bash.bashrc (is that ok?) and it shows up when I echo $LD_LIBRARY_PATH I also tried adding

Re: [Rd] Trying to configure R to use acml_mp

2010-08-25 Thread szembek
Ok, I have verified that ACML appears to be working because when I run set.seed (1) m <- 1 n <- 5000 A <- matrix (runif (m*n),m,n) system.time (B <- crossprod(A)) It multi threads properly. My initial test script doesn't seem to utilize multiple cores, I am going to paste it below if anyon

[Rd] No [[<-.factor()

2010-08-25 Thread William Dunlap
Should there be a [[<-.factor() that either throws an error or acts like [<-.factor() to avoid making an illegal object of class factor? > z <- factor(c("Two","Two","Three"), levels=c("One","Two","Three")) > z [1] Two Two Three Levels: One Two Three > str(z) Factor w/ 3 levels "On

[Rd] Speeding up transpose

2010-08-25 Thread Radford Neal
I've looked at how to speed up the transpose function in R (ie, t(X)). The existing code does the work with loops like the following: for (i = 0; i < len; i++) REAL(r)[i] = REAL(a)[(i / ncol) + (i % ncol) * nrow]; It seems a bit optimistic to expect a compiler to produce goo