Displaying 8 results from an estimated 8 matches for "sflapply".
2011 Sep 24
1
Can't reliably use RefClass methods in Snowfall
...o_calc = function(x) {print(x*x)})
my_calc <- calculator$new()
wrapper <- function(x) {my_calc$do_calc(x)}
# STANZA 2: use snowfall without wrapper -- WORKING
#sfInit(parallel=TRUE, cpus=2, type="SOCK")
#sfExport("calculator")
#sfExport("my_calc")
#results <- sfLapply(1:10,my_calc$do_calc)
#sfStop()
#print(results)
# STANZA 3: use snowfall with wrapper -- NOT WORKING
# (not working by itself, but does work if the previous stanza is run
first!!)
sfInit(parallel=TRUE, cpus=2, type="SOCK")
sfExport("calculator")
sfExport("my_calc")
s...
2008 Dec 06
1
snowfall sfInit error
Dear all,
I am trying to execute the simple example in snowfall
http://cran.r-project.org/web/packages/snowfall/vignettes/snowfall.pdf ...
require(snow)
require(snowfall)
sfInit( parallel=TRUE, cpus=2 )
sfLapply( 1:10, exp )
sfStop()
I have installed the snow and snowfall packages in R on a machine with
windows xp, however, after running the "sfInit( parallel=TRUE, cpus=2 )"
line I get an error ...
Error in system("whoami", intern = TRUE, ignore.stderr = TRUE) :
whoami not found
Err...
2009 May 09
1
Problem with package SNOW on MacOS X 10.5.5
Hi Greg,
I don't know if this is related to your problem, but
I get the same error (on both ubuntu and fedora linux, R 2.9) and just
found a very curious behaviour - snowfall apply functions don't like the
variable name "c".
E.g.:
c<-1
sfLapply(1:10, exp)
issues the same error you had posted, while subsequent
rm("c")
sfLapply(1:10, exp)
runs fine.
Rainer
On Wed, 31 Dec 2008, Greg Riddick wrote:
> Hello All,
>
> I can run the "lower level" functions OK, but many of the higher level
> (eg. parSAp...
2012 Apr 05
1
is parallel computing possible for 'rollapplyr' job?
...ackages (parallel, snow, snowfall,..) but could not solve my specific problem. As far as I understood, either I have to write a new function like sfRollapplyr or I have to change my code in a way that it utilizes lapply, or sapply instead of 'rollapplyr' first then use sfInit, sfExport, and sfLapply,.. for parallel computing. I could not perform either so please help me :)
##
nc<-313
rs<-500000
ema<-10
h<-4
gomin1sd<-function (x,rho)
{
getOutliers(as.vector(x),rho=c(1,1))$limit[1]
}
dim(dt_l1_inp)
[1] 500000 312
dt_l1_min1<-matrix(nrow=rs, ncol=nc-1-(ema*h))
for (i in 1:rs)...
2012 Jun 05
1
load coda in BRugs to perfor diagnostics
Dear all,
I just wrote a script to have each of my three mcmc chins running on a
different computer core to improve computation speed. To do it I use the
function sfLapply from the package snowfall.
Before using parallell computation, I did my diagnostic analyses just after
the model updating, but now I have to save the coda before.
Using the CODA package, it is possible to load the outputs in a mcmc.list to
perform some diagnostics but it doesn't work with func...
2010 Jan 05
1
Naming functions for the purpose of profiling
...<Anonymous> function. Of course, this can
in fact be any of several functions, but I am unable to see how I could
use the information from Rprof.out to discern which function is taking
the most time. An example line from my Rprof.out is:
rbernoulli <Anonymous> runOneRound FUN lapply sfLapply doTryCatch
tryCatchOne tryCatchList tryCatch try eval.with.vis eval.with.vis source
In my case, the <Anonymous> functions seem to be any of several
work-horse functions, that are part of a list, and different cases are
dispatched to different functions. I could of course get them all out...
2012 May 02
6
Quickest way to make a large "empty" file on disk?
R-helpers:
What would be the absolute fastest way to make a large "empty" file (e.g.
filled with all zeroes) on disk, given a byte size and a given number
number of empty values. I know I can use writeBin, but the "object" in
this case may be far too large to store in main memory. I'm asking because
I'm going to use this file in conjunction with mmap to do parallel
2012 Mar 25
2
avoiding for loops
I have data that looks like this:
> df1
group id
1 red A
2 red B
3 red C
4 blue D
5 blue E
6 blue F
I want a list of the groups containing vectors with the ids. I am
avoiding subset(), as it is
only recommended for interactive use. Here's what I have so far:
df1 <- data.frame(group=c("red", "red", "red", "blue",