Alan Feuerbacher
2019-Jan-28 21:05 UTC
[R] Newbie Question on R versus Matlab/Octave versus C
Hi, I recently learned of the existence of R through a physicist friend who uses it in his research. I've used Octave for a decade, and C for 35 years, but would like to learn R. These all have advantages and disadvantages for certain tasks, but as I'm new to R I hardly know how to evaluate them. Any suggestions? Thanks! --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
Rolf Turner
2019-Jan-28 23:20 UTC
[R] [FORGED] Newbie Question on R versus Matlab/Octave versus C
On 1/29/19 10:05 AM, Alan Feuerbacher wrote:> Hi, > > I recently learned of the existence of R through a physicist friend who > uses it in his research. I've used Octave for a decade, and C for 35 > years, but would like to learn R. These all have advantages and > disadvantages for certain tasks, but as I'm new to R I hardly know how > to evaluate them. Any suggestions?* C is fast, but with a syntax that is (to my mind) virtually incomprehensible. (You probably think differently about this.) * In C, you essentially have to roll your own for all tasks; in R, practically anything (well ...) that you want to do has already been programmed up. CRAN is a wonderful resource, and there's more on github. * The syntax of R meshes beautifully with *my* thought patterns; YMMV. * Why not just bog in and try R out? It's free, it's readily available, and there are a number of good online tutorials. cheers, Rolf Turner -- Honorary Research Fellow Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276
Gabor Grothendieck
2019-Jan-28 23:32 UTC
[R] Newbie Question on R versus Matlab/Octave versus C
R has many similarities to Octave. Have a look at: https://cran.r-project.org/doc/contrib/R-and-octave.txt https://CRAN.R-project.org/package=matconv On Mon, Jan 28, 2019 at 4:58 PM Alan Feuerbacher <alanf00 at comcast.net> wrote:> > Hi, > > I recently learned of the existence of R through a physicist friend who > uses it in his research. I've used Octave for a decade, and C for 35 > years, but would like to learn R. These all have advantages and > disadvantages for certain tasks, but as I'm new to R I hardly know how > to evaluate them. Any suggestions? > > Thanks! > > --- > This email has been checked for viruses by Avast antivirus software. > https://www.avast.com/antivirus > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.-- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com
Alan Feuerbacher
2019-Jan-29 00:00 UTC
[R] [FORGED] Newbie Question on R versus Matlab/Octave versus C
On 1/28/2019 4:20 PM, Rolf Turner wrote:> > On 1/29/19 10:05 AM, Alan Feuerbacher wrote: > >> Hi, >> >> I recently learned of the existence of R through a physicist friend >> who uses it in his research. I've used Octave for a decade, and C for >> 35 years, but would like to learn R. These all have advantages and >> disadvantages for certain tasks, but as I'm new to R I hardly know how >> to evaluate them. Any suggestions? > > * C is fast, but with a syntax that is (to my mind) virtually > ? incomprehensible.? (You probably think differently about this.)I've been doing it long enough that I have little problem with it, except for pointers. :-)> * In C, you essentially have to roll your own for all tasks; in R, > ? practically anything (well ...) that you want to do has already > ? been programmed up.? CRAN is a wonderful resource, and there's more > ? on github.>> * The syntax of R meshes beautifully with *my* thought patterns; YMMV. > > * Why not just bog in and try R out?? It's free, it's readily available, > ? and there are a number of good online tutorials.I just installed R on my Linux Fedora system, so I'll do that. I wonder if you'd care to comment on my little project that prompted this? As part of another project, I wanted to model population growth starting from a handful of starting individuals. This is exponential in the long run, of course, but I wanted to see how a few basic parameters affected the outcome. Using Octave, I modeled a single person as a "cell", which in Octave has a good deal of overhead. The program basically looped over the entire population, and updated each person according to the parameters, which included random statistical variations. So when the total population reached, say 10,000, and an update time of 1 day, the program had to execute 10,000 x 365 update operations for each year of growth. For large populations, say 100,000, the program did not return even after 24 hours of run time. So I switched to C, and used its "struct" declaration and an array of structs to model the population. This allowed the program to complete in under a minute as opposed to 24 hours+. So in line with your comments, C is far more efficient than Octave. How do you think R would fare in this simulation? Alan --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
Gabor Grothendieck
2019-Jan-29 15:11 UTC
[R] Newbie Question on R versus Matlab/Octave versus C
Two additional comments: - depending on the nature of your problem you may be able to get an analytic solution using branching processes. I found this approach successful when I once had to model stem cell growth. - in addition to NetLogo another alternative to R would be the Julia language which is motivated to some degree by Octave but is actually quite different and is particularly suitable in terms of performance for iterative computations where one iteration depends on the prior one. On Mon, Jan 28, 2019 at 6:32 PM Gabor Grothendieck <ggrothendieck at gmail.com> wrote:> > R has many similarities to Octave. Have a look at: > > https://cran.r-project.org/doc/contrib/R-and-octave.txt > https://CRAN.R-project.org/package=matconv > > On Mon, Jan 28, 2019 at 4:58 PM Alan Feuerbacher <alanf00 at comcast.net> wrote: > > > > Hi, > > > > I recently learned of the existence of R through a physicist friend who > > uses it in his research. I've used Octave for a decade, and C for 35 > > years, but would like to learn R. These all have advantages and > > disadvantages for certain tasks, but as I'm new to R I hardly know how > > to evaluate them. Any suggestions? > > > > Thanks! > > > > --- > > This email has been checked for viruses by Avast antivirus software. > > https://www.avast.com/antivirus > > > > ______________________________________________ > > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > > 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. > > > > -- > Statistics & Software Consulting > GKX Group, GKX Associates Inc. > tel: 1-877-GKX-GROUP > email: ggrothendieck at gmail.com-- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com
Martin Møller Skarbiniks Pedersen
2019-Jan-30 14:44 UTC
[R] Newbie Question on R versus Matlab/Octave versus C
On Mon, 28 Jan 2019 at 22:58, Alan Feuerbacher <alanf00 at comcast.net> wrote: [...]> These all have advantages and > disadvantages for certain tasks, but as I'm new to R I hardly know how > to evaluate them. Any suggestions?If you have one-hour left, you can download pdf file (8 pages total) "Getting started in R" from http://ilustat.com/shared/Getting-Started-in-R.pdf And then try running the code used in the examples. Regards Martin [[alternative HTML version deleted]]
Alan Feuerbacher
2019-Jan-30 16:27 UTC
[R] Newbie Question on R versus Matlab/Octave versus C
On 1/30/2019 7:44 AM, Martin M?ller Skarbiniks Pedersen wrote:> On Mon, 28 Jan 2019 at 22:58, Alan Feuerbacher <alanf00 at comcast.net > <mailto:alanf00 at comcast.net>> wrote: > > [...] > > > These all have advantages and > > disadvantages for certain tasks, but as I'm new to R I hardly know how > > to evaluate them. Any suggestions? > > If you have one-hour left, you > can download? pdf file (8 pages total) > "Getting started in R" > from http://ilustat.com/shared/Getting-Started-in-R.pdf > > And then try running the code used in the examples.Downloaded and in my pipeline. Thanks! Alan --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus