search for: splitlist

Displaying 19 results from an estimated 19 matches for "splitlist".

2012 Sep 07
6
splitting character vectors into multiple vectors using strsplit
Hi folks, Suppose I create the character vector charvec by > charvec<-c("a1.b1","a2.b2") > charvec [1] "a1.b1" "a2.b2" and then I use strsplit on charvec as follows: > splitlist<-strsplit(charvec,split=".",fixed=TRUE) > splitlist [[1]] [1] "a1" "b1" [[2]] [1] "a2" "b2" I was wondering whether there is already a function which can extract the "a" and "b" parts of the list splitlist; that is, that...
2018 Feb 12
2
[parallel] fixes load balancing of parLapplyLB
...com/questions/38230831/why-does-parlapplylb-not-actually-balance-load [2]: https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16792 ## The Call Chain First, we traced the relevant R function calls through the code, beginning with `parLapplyLB`: 1. **parLapplyLB:** clusterApply.R:177, calls **splitList**, then **clusterApplyLB** 2. **splitList:** clusterApply.R:157 3. **clusterApplyLB:** clusterApply.R:87, calls **dynamicClusterApply** 4. **dynamicClusterApply:** clusterApply.R:39 ## splitList We used both our whiteboard and an R session to manually *run* a few examples. We were using lists...
2018 Feb 19
2
[parallel] fixes load balancing of parLapplyLB
...e, there are two extremes in how you can split up the processing in chunks such that all workers are utilized: (A) Each worker, called multiple times, processes one element each time: > nbrOfElements <- 97 > nbrOfWorkers <- 5 > nbrOfChunks <- nbrOfElements > sapply(parallel:::splitList(1:nbrOfElements, nbrOfChunks), length) [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [30] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [59] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [88] 1 1 1 1 1 1 1 1 1 1 (B) Each worker, called once, processes mult...
2018 Feb 26
2
[parallel] fixes load balancing of parLapplyLB
...n chunks such that all workers are utilized: >> >> (A) Each worker, called multiple times, processes one element each >> time: >> >>> nbrOfElements <- 97 >>> nbrOfWorkers <- 5 >>> nbrOfChunks <- nbrOfElements >>> sapply(parallel:::splitList(1:nbrOfElements, nbrOfChunks), length) >> [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 >> [30] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 >> [59] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 >> [88] 1 1 1 1 1 1 1 1 1 1 >> &g...
2018 Feb 20
0
[parallel] fixes load balancing of parLapplyLB
...can split up the >processing in chunks such that all workers are utilized: > >(A) Each worker, called multiple times, processes one element each >time: > >> nbrOfElements <- 97 >> nbrOfWorkers <- 5 >> nbrOfChunks <- nbrOfElements >> sapply(parallel:::splitList(1:nbrOfElements, nbrOfChunks), length) > [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 >[30] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 >[59] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 >[88] 1 1 1 1 1 1 1 1 1 1 > > >(B) Each worker,...
2010 Oct 04
1
Splitting a DF into rows according to a column
...an ordered manner according to column2 (first DF ist o contain the rows with the 50 largest numbers, ...). Here is what I have been doing: > binSize <- 50 > splitMembership <- pmin(ceiling(order(tmpDF[["Column2"]],decreasing=TRUE)/binSize),floor(nrow(tmpDF)/binSize)) > splitList <- split(tmpDF,splitMembership) Distribution seems to work ... > sapply(splitList,nrow) But this is NOT what I wanted ... > sapply(splitList,function(x){max(x[["Column2"]])}) This was supposed to give me bins that are Column2-sorted and bin one should have a higher max than 2...
2018 Feb 19
0
[parallel] fixes load balancing of parLapplyLB
...ciency 97.36 ``` The graph from our monitoring system is attached. As you can see, the load balancing works to a satisfying degree and the efficiency is well above 90% which was what I had hoped for :-) ## Additional Notes The list used in this jobs `parLapplyLB` is 5812 elements long. With the `splitList`-chunking from the patch, you'll get 208 lists of about 28 elements (208 chunks of size 28). The job ran on 28 CPU cores and had a wallclock time of 120351.590 seconds, i.e. 33.43 hours. Thus, the function we apply to our list takes about 580 seconds per list element, i.e. about 10 minutes. I s...
2018 Mar 01
0
[parallel] fixes load balancing of parLapplyLB
...re utilized: >>> >>> (A) Each worker, called multiple times, processes one element each >>> time: >>> >>>> nbrOfElements <- 97 >>>> nbrOfWorkers <- 5 >>>> nbrOfChunks <- nbrOfElements >>>> sapply(parallel:::splitList(1:nbrOfElements, nbrOfChunks), length) >>> [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 >>> [30] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 >>> [59] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 >>> [88] 1 1 1 1 1 1 1 1...
2009 Nov 10
3
creating multiple plots using a splitting factor
...14 GVM 1 14.9 15 GVM 1 25.4 16 WRR 1 25.4 17 WRR 1 35.0 18 WRR 1 45.0 19 WRR 1 55.0 20 WRR 1 60.0 Here is what I tried to get separate histograms of distance_cm by site: splitlist<- split(seeddist2, site) lapply(splitlist, hist(distance_cm, breaks=10)) I then get an error message saying that "match.fun" didn't find the function. Is there another way to produce multiple graphs at once? Thank you, Danielle B. Johnston, Habitat Researcher Colorad...
2010 Mar 26
2
DISPLAYING TABLE in file
Hi, I wish to NEATLY store, and later display one table per file (similar to capabilities of write.table()). BUT BY NEATLY I MEAN: 1. Column Headings right aligned with data values. 2. Decimal points line-up per column. 3. Data values padded trailing zeros per column (if not integers). 4. "Tricky" formats such as certain characters/dates possibly chosen by the user? bla bla bla I do
2018 Mar 15
2
clusterApply arguments
...X = 1:2, fun = fun, c = 1) shouldn't give an error. This could be easily avoided by using all the argument names in the custerApply call of parLapply which means changing, parLapply <- function(cl = NULL, X, fun, ...) { cl <- defaultCluster(cl) do.call(c, clusterApply(cl, x = splitList(X, length(cl)), fun = lapply, fun, ...), quote = TRUE) } to parLapply <- function (cl = NULL, X, fun, ...) { cl <- defaultCluster(cl) do.call(c, clusterApply(cl = cl, x = splitList(X, length(cl)), fun = lapply, fun, ...), quote = TRUE) } . Best regards,...
2000 Mar 07
3
Merging data.frames
On Tuesday, March 07, 2000 5:40 PM, Richard Bilonick wrote: >I need to merge several data.frames into one data.frame. In S-Plus I would >use >"merge" but I don't see a merge command in R. What is the best way to >accomplish >this? The easiest way to to this, I think, is as follows: if you have several data frames, dataframe1, dataframe2, . . . , dataframen, you
2018 Mar 15
1
clusterApply arguments
...gt; >> This could be easily avoided by using all the argument >> names in the custerApply call of parLapply which means changing, >> >> parLapply <- function(cl = NULL, X, fun, ...) { >> cl <- defaultCluster(cl) >> do.call(c, clusterApply(cl, x = splitList(X, length(cl)), >> fun = lapply, fun, ...), quote = TRUE) >> } >> >> to >> >> parLapply <- function (cl = NULL, X, fun, ...) { >> cl <- defaultCluster(cl) >> do.call(c, clusterApply(cl = cl, x = splitList(X, length(cl)),...
2018 Mar 15
0
clusterApply arguments
...ldn't give an error. > > This could be easily avoided by using all the argument > names in the custerApply call of parLapply which means changing, > > parLapply <- function(cl = NULL, X, fun, ...) { > cl <- defaultCluster(cl) > do.call(c, clusterApply(cl, x = splitList(X, length(cl)), > fun = lapply, fun, ...), quote = TRUE) > } > > to > > parLapply <- function (cl = NULL, X, fun, ...) { > cl <- defaultCluster(cl) > do.call(c, clusterApply(cl = cl, x = splitList(X, length(cl)), > fun = lapply, fun,...
2014 Dec 06
1
does parLapplyLB do load-balancing?
Looking at parLapplyLB, one sees that it takes in X and then passes splitList(X, length(cl)) to clusterApplyLB, which then calls dynamicClusterApply. Thus while dynamicClusterApply does handle tasks in a load-balancing fashion, sending out individual tasks as previous tasks complete, parLapplyLB preempts that by splitting up the tasks in advance into as many groups of tasks...
2018 Mar 14
2
clusterApply arguments
Hi! I recognized that the argument matching of clusterApply (and therefore parLapply) goes wrong when one of the arguments of the function is called "c". In this case, the argument "c" is used as cluster and the functions give the following error message "Error in checkCluster(cl) : not a valid cluster". Of course, "c" is for many reasons an unfortunate
2010 Dec 02
1
parLapply - Error in do.call("fun", lapply(args, enquote)) : could not find function "fun"
Hello everybody, I've got a bit of a problem with parLapply that's left me scratching my head today. I've tried this in R 2.11 and the 23 bit Revolution R Enterprise and gotten the same result, OS in question is Windows XP, the package involved is the snow package. I've got a list of 20 rain/no rain (1/0) situations for these two stations i and j, all the items in this list look
2007 Apr 24
2
Error in clusterApply(): recursive default argument reference
...y the permutations of node labels (to preserve the graph topology). Since I ll have many permutations to perform, I was thinking of using the snow package and in particular "parSapply" to divide the work between my 4 CPUs. But I get the following error message : Error in clusterApply(cl, splitList(x, length(cl)), lapply, fun, ...) : recursive default argument reference What am i doing wrong ? Some details about my platform and R version : ----------------------------------------------- $platform [1] "x86_64-redhat-linux-gnu" $version.string [1] "R version 2.4.1 (200...
2013 Sep 04
0
Error in Parts of Speach Tagging using openNLP in Cloud environment
...tal 12.10 Server 64-bit instance. I am using openNLP for POS Tagging of sentences. I am using POS tagging using openNLP with “Parallel Lapply setup”. It is running fine in RStudio environment. But in Ubuntu environment it is showing the following error. *Error in do.call(c, clusterApply(cl, x = splitList(X, length(cl)), fun = lapply, :* * second argument must be a list* Any suggestion for the problem I’m facing? This is the code that I am using: tagPOS <- function(x, ...) { s <- as.String(x) word_token_annotator <- Maxent_Word_Token_Annotator() a2 <- Annotatio...