similar to: syntax difference clusterExport in parallel and snow

Displaying 20 results from an estimated 8000 matches similar to: "syntax difference clusterExport in parallel and snow"

2012 Sep 21
2
Parallel Programming
I am trying to do parallel programming and I tried this library(doSNOW) library(foreach) testfunc<-function(x){ x<-x+1 x } noc<-2 cl <- makeCluster(do.call(rbind,rep(list("localhost"),noc)), type = "SOCK") registerDoSNOW(cl) clusterExport(cl=cl,c("testfunc.r")) testl<-foreach(pp=1:2) %dopar% { testfunc(pp) } And this works but if I try to
2012 Aug 03
1
Parallel runs of an external executable with snow in local
Hi everyone, I'm aiming to run an external executable (say filetorun.EXE) in parallel. The external executable collect needed data from a file, say "input.txt" and, in turn,generates several output files, say "output.txt". I need to generate "input.txt", run the executable and keep "input.txt" and "output.txt". I'm using Windows 7, R
2008 Nov 30
2
Snow and multi-processing
Dear R gurus, I have a very embarrassingly parallelizable job that I am trying to speed up with snow on our local cluster. Basically, I am doing ~50,000 t.test for a series of micro-array experiments, one gene at a time. Thus, I can easily spread the load across multiple processors and nodes. So, I have a master list object that tells me what rows to pick up for each genes to do the t.test from
2011 Jun 12
1
snow package
Hi I try parallelising some code using the snow package and the following lines: cl <- makeSOCKcluster(8) pfunc <- function (x) (if(x <= (-th)) 1 else 0) ###correlation coefficient clusterExport(cl,c("pfunc","th")) cor.c.f <- parApply(cl,tms,c(1,2),FUN=pfunc) The parApply results in the error message: > cor.c.f <- parApply(cl,tms,c(1,2),FUN=pfunc) Error
2003 Oct 08
2
Generating automatic plots
Hello, I have been trying to write a small program to generate automatic plots. What I want is to draw boxplots for some variables in my data frame, contrasting with a variable called 'missing' that has value 1 if some variable in a concrete case has at least one missing value, in order to check if the cases that don't enter in my analysis are biased. The first attempt was to
2010 Feb 18
1
variable substitution
Hi I would like to write a script that reads a list of variable names. These variable names are some of the column headers in a data.frame. Then I want do a for-loop to execute various operations on the specified variables in the data.frame, but can't figure out how to do the necessary variable substitution. In bash (or C) I would use "$var", but there seems to be no equivalent in
2012 Nov 24
1
Bootstrap lmekin model
Hi,I use the 'lmekin' model of the 'kinship' package of R in order to estimate heritability. I want to estimate the confidence interval of the variance coefficient and so I should use a bootstrap simulation. The pedigree file has 1386 subjects so I create a kinship matrix [1386*1386].This is the code of R I use: kfit2 <- lmekin(IT~1+AGE +(1|ID), dati1,
2005 Feb 08
5
How to get variable names in a function?
Hello, applying a function to a list of variables I face the following problem: Let's say I want to compute tables for several variables. I could write a command for every single table, like bravo<-c(1,1,2,3,5,5,5,);charly<-c(7,7,4,4,2,1) table(bravo); table(charly) > table(bravo); table(charly) bravo 1 2 3 5 2 1 1 3 charly 1 2 4 7 1 1 2 2 The results are two tables with the
2016 Apr 12
2
Procesos paralelos
Hola: Vuelvo a la carga con algo que resolví hace años y que ahora me ha dejado de funcionar y no consigo arreglar. A ver si alguien me sugiere algún enfoque o directamente la solucion. Utilizo R en muchos procesos ETL y la cuestión es que me encuentro con que tengo que hacer inserts en un BBDD de SQL Server de varios miles (a veces millones de registros) que mientras R las realiza parece que
2011 Apr 15
1
no solution yet, please help: extract p-value from mixed model in kinship package
I am making the question clear. Please help. > Dear R experts > > I was using kinship package to fit mixed model with kinship matrix. > The package looks like lme4, but I could find a way to extract p-value > out of it. I need to extract is as I need to analyse large number of > variables (> 10000). > > Please help me: > > require(kinship) > > #Generating
2009 Oct 11
1
How do you test if a number is in a list of numbers?
Hi, I want to subset a data frame if one of the variables matches any in a list. I could of course do something like this: subset(dataset, var == 1 | var == 2 | var ==3) but that's tedious. I tried varlist = c(1,2,3,4) subset(dataset, any(var == varlist)) but it doesn't work because 'any' doesn't go row-by-row and hence always returns TRUE. Is there any simple way to do this?
2013 Feb 18
3
foreach loop, stata equivalent
Hi! I'm a recent convert from Stata, so forgive my ignorance. In Stata, I can write foreach loops (example below) foreach var of varlist p1-p14 { foreach y of varlist p15-p269 { reg `var' `y' } } It's looping p1-p15, p1-p16...., p1-p269, p2-p15, p2-p16,... p2-p269,... variable pairs. How can I write something similar in R? I 'tried' understanding the
2009 Nov 17
2
SVM Param Tuning with using SNOW package
Hello, Is the first time I am using SNOW package and I am trying to tune the cost parameter for a linear SVM, where the cost (variable cost1) takes 10 values between 0.5 and 30. I have a large dataset and a pc which is not very powerful, so I need to tune the parameters using both CPUs of the pc. Somehow I cannot manage to do it. It seems that both CPUs are fitting the model for the same values
2007 Feb 02
1
Snow Package and R: Exported Variable Problem
Hello and thanks in advance for your time. I've created a simulation on my cluster which uses a custom package developed by me for different functions and also the snow package. Right now I'm using LAM to communicate between nodes and am currently only testing my code on 3 nodes for simplicity, though I plan on expanding to 16 later. My problem is this error: "Error in
2010 Feb 25
3
variable substitution in for loops
Friends I can't quite find a direct answer to this question from the lists, so here goes: I have several dataframes, 200+ columns 2000+ rows. I wish to script some operations to perform on some of the variables (columns) in the data frames not knowing what the column number is, hence have to refer by name. I have variable names in a text file "varlist". So, something like this:
2015 Nov 17
1
Exporting a method to a cluster object
Hi, This is my first message to this list. It would be great if people here could help me with the following problem (self-contained code example below): I have a list of matrices and would like to apply a summary function to the matrices in the list. The matrices represent social networks, therefore I need to apply some specialized summary functions provided by the ergm package. These
2012 Oct 18
1
Getting a table of coefficients from R
Hi,? I'm trying to obtain a table of coefficients and confidence intervals from a logistic regression analysis in R. My code is as follows: # read in csv file datafile<-read.csv("file.csv", row.names=1) # read in the variable list varlist<-names(datafile)[66:180] models<-lapply(varlist, function(x) {glm(substitute(outcome ~ i, list(i=as.name(x))), data=datafile, family =
2010 Oct 12
1
Help with function writing
Hello all I have what seems like a simple question but have not been able to find an answer on the forum. I'm trying to define a function which involves regression models and a large number of covariates. I would like the function to accept any number of covariates and, ideally, I would like to be able to enter the covariates in a group (e.g. as a list) rather than individually. Is there any
2010 Jul 22
0
snow: hierarchical parallelization
I'm parallelizing some computation on hierarchical data, and would find it natural to do something like this (where a call to parLapply is embedded in outer call to parLapply): cl <- makeCluster(rep.int('localhost', 5), type='SOCK') clusterExport(cl, 'cl') parLapply(cl, 1:5, function(i) parLapply(cl, 1:5, function(j) i * j)) Snow
2015 Dec 01
1
Package Dependency
Lately, I see a dependency problem with R-3.2 systems. install.packages allows dependencies, but they are not installed so the install fails. I see this a lot with students who are able to install packages like ggplot2 but then can't load it because a dependency "stringi" is missing. Those students are generally using Windows, but today I reproduced the same on RedHat Linux with