Displaying 6 results from an estimated 6 matches for "sfsapply".
Did you mean:
sflapply
2012 Jun 28
1
undefined S4 class in parallel computing at snowfall
...t;- function(y1) { new('catt', aa = y1 + 1) }
f3 <- function(y2, y3) { new('dogg', bb=c(y2, 'GA'), cc = f1(y3)) }
dat <- 1:5
f1(dat)
f3('NY', dat)
sapply(c("state1", 'state2', 'state3'), f3, dat)
sfExportAll()
sfClusterEval(ls())
sfSapply(c("s1", 's2', 's3'), f3, dat)
sfStop()
# sfSapply generates the following error
# Error in checkForRemoteErrors(val) :
# 2 nodes produced errors; first error: "dogg" is not a defined class
=== end =============
--
View this message in context: http:/...
2012 Feb 11
1
R Parallel question
Hi All,
I have a question about R parallel computing by using snowfall.
How can I set the seeds on parallel workers to get the same result as
sequential mode?
For example:
> sfSapply(c(1,1),rnorm)
[1] 1.823082 -2.222052
> rnorm(2)
[1] -0.5179967 -1.0807196
How to get the identical result?
Thanks.
Libo Sun
Graduate Student,
Department of Statistics,
Colorado State University
Fort Collins, CO
--
View this message in context: http://r.789695.n4.nabble.com/R-Parallel-quest...
2011 Dec 20
1
Convert ragged list to structured matrix efficiently
...in size, (i have 24GB of memory so can
load it) but it takes a LONG time to run the code on a large dataset. I
was wondering if anyone had any tips or tricks that may make this run
faster?
Below is some sample code of what ive been doing, (in the full version i
use snowfall to spread the work via sfSapply)
bhvs <- c(1,2,3,4,5,6)
ragged.list <- list('23' = c(13,4,5,6,3,65,67,2),
'34' = c(1,2,3,4,56,7,8),
'45' = c(5,6,89,87,56))
# Define the matrix to store results
cluster.data <- as.data.frame(matrix(0, length(bhvs), nrow =
le...
2011 Dec 23
2
missing value where TRUE/FALSE needed
Merry Xmas to all,
I am writing a function and curiously this runs sometimes on one data set
and fails on another and i cannot figure out why.
Any help much appreciated.
If i run the code below with
data <- iris[ ,1:4]
The code runs fine, but if i run on a large dataset i get the following
error (showing data structures as matrix is large)
> str(cluster.data)
num [1:9985, 1:811] 0 0 0 0
2010 Dec 10
2
Could concurrent R sessions mix up variables?
Hi, I'm working in R 2.11.1 x64 on Windows x86_64-pc-mingw32.
I'm experiencing a strange problem in R that I'm not even sure how to
begin to fix.
I've got a huge (forty-pages printed) simulation written in R that I'd
like to run multiple times. When I open up R and run it on its own,
it works fine. At the beginning of the program, there's a variable X
that I set to 1,
2010 Dec 11
0
is there a packge or code to generate markov chains in R
...00000,max(rnorm(100,mu))))
> library(multicore)
> unlist(mclapply(c(1,5,10,20),sim))
[1] 6.569332 10.268091 15.335847 25.291502
Using snowfall:
> library(snowfall)
> sim = function(mu)max(replicate(100000,max(rnorm(100,mu))))
> sfInit(cpus=4,type='SOCK',parallel=TRUE)
> sfSapply(c(1,5,10,20),sim)
[1] 6.200161 10.307807 15.271581 25.055950
Hope this helps.
- Phil Spector
Statistical Computing Facility
Department of Statistics
UC Berkeley
spector at stat.berkeley.edu
On Fri, 10 Dec 2010, Anthony Damico wrote:
> Hi, I'm worki...