similar to: %dopar% parallel processing experiment

Displaying 20 results from an estimated 3000 matches similar to: "%dopar% parallel processing experiment"

2011 Oct 10
5
multicore by(), like mclapply?
dear r experts---Is there a multicore equivalent of by(), just like mclapply() is the multicore equivalent of lapply()? if not, is there a fast way to convert a data.table into a list based on a column that lapply and mclapply can consume? advice appreciated...as always. regards, /iaw ---- Ivo Welch (ivo.welch at gmail.com)
2004 Nov 01
2
non-linear solve?
hi: could someone please point me to a function that allows me to solve general non-linear functions? > irr.in <- function(r, c1, c2, c3 ) { return(c1+c2/(1+r) + c3/(1+r)^2); } > solve.nonlinear( irr.in, -100, 60, 70 ); 0.189 If someone has written an irr function, this would be helpful, too---though not difficult to write, either. thanks for any pointers. Regards, /iaw
2012 Nov 08
3
vectorized uni-root?
dear R experts--- I have (many) unidimensional root problems. think loc.of.root <- uniroot( f= function(x,a) log( exp(a) + a) + a, c(.,9e10), a=rnorm(1) ) $root (for some coefficients a, there won't be a solution; for others, it may exceed the domain. implied volatilities in various Black-Scholes formulas and variant formulas are like this, too.) except I don't need 1 root, but a
2010 May 11
3
Revolution R and the R Community?
As an end-user, I wonder about Revolution R. Is the relationship between Revolution R and the R community at-large a positive one? Do the former contribute to the development efforts of the latter? Is there a competitive aspect? is their forum competitive with r-help? any other thoughts? (most of all, I simply hope that they help some of the many helpful experts on this forum, who have
2011 Apr 02
1
uniroot speed and vectorization?
curiosity---given that vector operations are so much faster than scalar operations, would it make sense to make uniroot vectorized? if I read the uniroot docs correctly, uniroot() calls an external C routine which seems to be a scalar function. that must be slow. I am thinking a vectorized version would be useful for an example such as of <- function(x,a) ( log(x)+x+a ) uniroot( of, c(
2011 Feb 11
1
foreach with registerDoMC on R 2.12.0 OSX 10.6 --- errors and warnings
some hints for the search engines. I just did install.packages("foreach") install.packages("doMC") library(doMC) registerDoMC() library(foreach) > foreach(i = 1:3) %dopar% sqrt(i) The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec(). Break on
2011 Aug 17
1
R cmd check and multicore foreach loop
Hi, in R 2.12.1, R CMD check hangs when building a vignette that uses a foreach loop with the doMC parallel backend. This does not happen in R 2.13.1, nor if I use doSEQ instead of doMC. All versions of multicore, doMC and foreach are the same on both my R installations. Has anybody encountered a similar issue? Thank you. Renaud ### UNIVERSITY OF CAPE TOWN This e-mail is subject to the
2011 Jul 02
1
Speed Advice for R --- avoid data frames
This email is intended for R users that are not that familiar with R internals and are searching google about how to speed up R. Despite common misperception, R is not slow when it comes to iterative access. R is fast when it comes to matrices. R is very slow when it comes to iterative access into data frames. Such access occurs when a user uses "data$varname[index]", which is a very
2010 Nov 03
1
Auto-killing processes spawned by foreach::doMC
Hi all, Sometimes I'll find myself "ctrl-c"-ing like a madman to kill some code that's parallelized via foreach/doMC when I realized that I just set my cpu off to do something boneheaded, and it will keep doing that thing for a while. In these situations, since I interrupted its normal execution, foreach/doMC doesn't "clean up" after itself by killing the
2013 Feb 06
5
First R Package --- Advice?
Dear R experts--- after many years, I am planning to give in and write my first R package. I want to combine my collection of collected useful utility routines. as my guide, I am planning to use Friedrich Leisch's "Creating R Packages: A Tutorial" from Sep 2009. Is there a newer or better tutorial? this one is 4 years old. I also plan on one change---given that the
2012 Mar 30
4
list assignment syntax?
Dear R wizards: is there a clean way to assign to elements in a list? what I would like to do, in pseudo R+perl notation is f <- function(a,b) list(a+b,a-b) (c,d) <- f(1,2) and have c be assigned 1+2 and d be assigned 1-2. right now, I use the clunky x <- f(1,2) c <- x[[1]] d <- x[[2]] rm(x) which seems awful. is there a nicer syntax? regards, /iaw ---- Ivo Welch
2015 Feb 09
2
R CMD check: Uses the superseded package: ‘doSNOW’
Dear list, When I run an R CMD check --as-cran on my package (pROC) I get the following note: > Uses the superseded package: ?doSNOW? The fact that it uses the doSNOW package is correct as I have the following example in an .Rd file: > #ifdef windows > if (require(doSNOW)) { > registerDoSNOW(cl <- makeCluster(2, type = "SOCK")) > ci(roc2,
2012 Mar 26
1
assigning vector or matrix sparsely (for use with mclapply)
Dear R wizards--- I have a wrapper on mclapply() that makes it a little easier for me to do multiprocessing. (Posting this may make life easier for other googlers.) I pass a data frame, a vector that tells me what rows should be recomputed, and the function; and I get back a vector or matrix of answers. d <- data.frame( id=1:6, val=11:16 ) loc <- c(TRUE,TRUE,FALSE,TRUE,FALSE,TRUE)
2013 Feb 07
4
Hard Stop?
is it possible to throw a stop() that is so hard that it will escape even tryCatch? /iaw ---- Ivo Welch (ivo.welch at gmail.com)
2013 Apr 04
6
categorized complete list of R commands?
every time I read the R release notes for the next release, I see many functions that I had forgotten about and many functions that I never knew existed to begin with. (who knew there were bibtex facilities in R? obviously, everyone except me.) I wonder whether there is a complete list of all R commands (incl the standard packages) somewhere, preferably each with its one-liner AND
2010 Jan 08
4
fast lm se?
dear R experts---I am using the coef() function to pick off the coefficients from an lm() object. alas, I also need the standard errors and I need them fast. I know I can do a "summary()" on the object and pick them off this way, but this computes other stuff I do not need. Or, I can compute (X' X)^(-1) s^2 myself. Has someone written a fast se() function? incidentally, I think
2011 Oct 17
2
Foreach (doMC)
Hello, I am trying to run a small example with foreach, but I am having some problems. Here is the code: *library(doMC) registerDoMC() zappa = list() frank = list() foreach (i = 1:4) %dopar% { zappa[[i]] = kmeans (iris[-5],4) frank[[i]] = warnings() }* The code runs without error. However the zappa and frank will be empty lists. If I use regular *for *instead, the list will be filled up
2010 Jun 11
3
lm without error
this is not an important question, but I wonder why lm returns an error, and whether this can be shut off. it would seem to me that returning NA's would make more sense in some cases---after all, the problem is clearly that coefficients cannot be computed. I know that I can trap the lm.fit() error---although I have always found this to be quite inconvenient---and this is easy if I have only
2010 Aug 30
4
different interface to by (tapply)?
dear R experts: has someone written a function that returns the results of by() as a data frame? ??of course, this can work only if the output of the function that is an argument to by() is a numerical vector. presumably, what is now names(byobject) would become a column in the data frame, and the by object's list elements would become columns. it's a little bit like flattening the by()
2012 May 31
2
print.data.frame to string?
dear R experts---is there a function that prints a data frame to a string? cat() cannot handle lists, so I cannot write cat("your data frame is:\n", df, "\n"). regards, /iaw ---- Ivo Welch (ivo.welch@gmail.com) [[alternative HTML version deleted]]