Hi, Carl.  I have a feeling that there's some way to do this with R's parsing tools, but I've been unable to come up with a solution.

OTOH, I was able to get sfLibrary to run without error messages by adding "character.only=TRUE" to the call to sfLibrary.  Please see the appended for an example.  Note that I have no idea what sfLibrary is supposed to do, so I can't say that this left things in a rational state, only that the error message went away.

-- Mike


> libs <- names(sessionInfo()[[5]])


> libs
[1] "Biobase"  "snowfall" "snow"    


> for (lib in libs)
+     sfLibrary(lib)
Warning messages:
1: In library(package = "lib", character.only = TRUE, pos = 2, warn.conflicts = TRUE,  :
  there is no package called 'lib'
2: In sfLibrary(lib) : Unable to load library: Biobase
3: In library(package = "lib", character.only = TRUE, pos = 2, warn.conflicts = TRUE,  :
  there is no package called 'lib'
4: In sfLibrary(lib) : Unable to load library: snowfall
5: In library(package = "lib", character.only = TRUE, pos = 2, warn.conflicts = TRUE,  :
  there is no package called 'lib'
6: In sfLibrary(lib) : Unable to load library: snow


> for (lib in libs)
+     sfLibrary(lib, character.only=TRUE)
> 





>________________________________
>From: Carl Boettiger <cboettig@gmail.com>
>To: r-sig-hpc@r-project.org
>Sent: Sunday, August 28, 2011 12:16 PM
>Subject: [R-sig-hpc] loading libraries in snowfall
>
>Hi all,
>
>I'd like to be able to load all current libraries onto the cluster using
>sfLibrary.  While library() function can take a package name with or without
>quotes: library("snowfall") or library(snowfall), it seems this is not true
>for sfLibrary, which seems to prevent this from working:
>sfLibrary("ape") doesn't work, even though sfLibrary(ape) works.
>
>For instance, I get the names of the currently loaded libraries:
>
>libs <- names(sessionInfo()[[5]])
>
># and then try to load them:
>
>for(lib in libs)
>  sfLibrary(lib)
>
>They are passed as character objects, so the load command fails. Any way to
>get around this?  Is there a very good reason *not* to do this this way?
>(i.e. one trouble is it will try and export snowfall itself onto the
>cluster, though this could be explicitly removed from the list..)
>
>
>Bigger picture: I have a function which uses the snowfall commands to work
>in parallel.  The function applies some generic methods like update() and
>simulate() to the objects it is given.  These objects may be defined in
>custom libraries, so the function will not be able to work in parallel on
>these objects without calling sfLibrary.  Of course I can have the
>user initialize the parallelization all by hand before calling the function,
>but it would be nice to have this built in.  snowfall comes pretty close to
>being able to do this, but I haven't found a way around this when those
>commands require some of the local libraries.  Any suggestions?
>
>-Carl
>
>-- 
>Carl Boettiger
>UC Davis
>http://www.carlboettiger.info/
>
>    [[alternative HTML version deleted]]
>
>_______________________________________________
>R-sig-hpc mailing list
>R-sig-hpc@r-project.org
>https://stat.ethz.ch/mailman/listinfo/r-sig-hpc
>
>
>
	[[alternative HTML version deleted]]

