[R] R on Multicore for Linux

Uwe Ligges ligges at statistik.tu-dortmund.de
Wed Jul 27 19:48:47 CEST 2011



On 24.07.2011 20:15, Madana_Babu wrote:
> Hi Lei,
> Thanks for your solution. It worked. Now I have another query.
>
> After creating multiple DF[[i]]'s how do I aggregate them into one data frame say DF (I want to bind all the data frames into one data frame). I have more than 1000 DF[[i]]'s how can I bind them into one DF by recursively?

oneDF <- do.call("rbind", DF)

Uwe Ligges



>
> Thanks for your help.
> Regards,
> Madana
> From: Lei Jiang [via R] [mailto:ml-node+3688529-54131105-22116 at n4.nabble.com]
> Sent: Saturday, July 23, 2011 1:43 PM
> To: Madana Mohana Babu
> Subject: Re: R on Multicore for Linux
>
> Madana,
>
> The code below may work (untested though):
>
> #above is the same as you wrote
> require(multicore)
>
> read.data.exmple<- function(f)
> {
>         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")
>         data_1
> }
>
> DF<- mclapply(a, read.data.example)
>
> #you can check the components of DF by DF[[1]], DF[[2]] ..., which is a bit
> different from rbind
> #feel free to add more arguments to function read.data.example and add those
> to mclapply accordingly
>
> Hope this helps.
>
> Regards,
> Lei
>
> On Fri, Jul 22, 2011 at 11:35 AM, Madana_Babu<[hidden email]</user/SendEmail.jtp?type=node&node=3688529&i=0>>wrote:
>
>> Hi,
>>
>> Can you please explain me that how can i perform this on a multicore
>> processor? since i have a machine with 16-cores. I can do this much faster
>> if i use all cores.
>>
>> Thanks in advance...
>>
>> Regards,
>> Madana
>>
>> --
>> View this message in context:
>> http://r.789695.n4.nabble.com/R-on-Multicore-for-Linux-tp3682318p3687483.html
>> Sent from the R help mailing list archive at Nabble.com.
>>          [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email]</user/SendEmail.jtp?type=node&node=3688529&i=1>  mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>
>
> --
> Lei Jiang
>
> Center for Computation and Technology/
> Department of Computer Science
> Louisiana State University
>
> E-mail: [hidden email]</user/SendEmail.jtp?type=node&node=3688529&i=2>
>
>          [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email]</user/SendEmail.jtp?type=node&node=3688529&i=3>  mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://r.789695.n4.nabble.com/R-on-Multicore-for-Linux-tp3682318p3688529.html
> To unsubscribe from R on Multicore for Linux, click here<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3682318&code=bWFkYW5hX2JhYnVAaW5mb3N5cy5jb218MzY4MjMxOHwxMzY2NzI1OTQ5>.
>
> **************** CAUTION - Disclaimer *****************
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
> for the use of the addressee(s). If you are not the intended recipient, please
> notify the sender by e-mail and delete the original message. Further, you are not
> to copy, disclose, or distribute this e-mail or its contents to any other person and
> any such actions are unlawful. This e-mail may contain viruses. Infosys has taken
> every reasonable precaution to minimize this risk, but is not liable for any damage
> you may sustain as a result of any virus in this e-mail. You should carry out your
> own virus checks before opening the e-mail or attachment. Infosys reserves the
> right to monitor and review the content of all messages sent to or from this e-mail
> address. Messages sent to or from this e-mail address may be stored on the
> Infosys e-mail system.
> ***INFOSYS******** End of Disclaimer ********INFOSYS***
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/R-on-Multicore-for-Linux-tp3682318p3690669.html
> Sent from the R help mailing list archive at Nabble.com.
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list