[R] R with Multicore running on Linux

Madana_Babu madana_babu at infosys.com
Thu Jul 21 23:24:04 CEST 2011


Hi all, 

Currently i am trying this on R which is running on multicore processor. I
am not sure how to use mclapply() function on this task. Can anyone help me. 


# Setting up directory 
setwd("/XXX/XXXXXXXX/XXXX/XXXX/2011/07/20") 
library(sqldf) 

# Data is available in the form of multiple structured log files (nearly 10K
log files) 

# I am using the following syntax to get required fields and aggregations
from the logs and creating a file called DF (with 3 columns V2, V14 and
Min(V16)) 

a <- list.files(path = ".", pattern = "2011-07-20", all.files = FALSE,
full.names = FALSE, recursive = FALSE, ignore.case = FALSE) 

DF <- NULL 
for (f in a) 
{ 
        dat <- read.csv(f, header=FALSE, sep="\t", na.strings="",dec=".",
strip.white=TRUE, fill=TRUE) 
        data_1 <- sqldf("SELECT V2, V14, MIN(V16) FROM dat WHERE V6=104
GROUP BY V2, V14") 
        DF <- rbind(DF, data_1) 
} 

# Currently this process is taking almost 3 Hrs for me. 

Can anyone help me to use mclapply() on this operation and get this process
completed asap. 

Request you to provide me the syntax. 

Thanks in advance 

Regards, 
Madana

--
View this message in context: http://r.789695.n4.nabble.com/R-with-Multicore-running-on-Linux-tp3685137p3685137.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list