JIT of R code using Ra - r

I just discovered Ra from Ubuntu repositories. Has anyone used it in actual projects? Have you encountered any problems and are there any trade offs with using Ra instead of R or JIT in general?

Well, I like it. But then it is in Ubuntu ... because I created the Debian package in the first place. And I feature Ra and jit in my 'Intro to High-Performance Computing with R' tutorials (next one on Tuesday at useR! 2010).
But sadly, Steven never got the feedback he anticipated and has stopped updating Ra. The most recent version is R 2.9.*, i.e. from a year ago. This would be worth keeping alive, but a few more people (with highly specialized knowledge) would need to appear on the scene to help...

Since this question was asked the {compiler} R package was introduced. I wrote a post describing what I have found this far regarding the use of JIT and R:
http://www.r-statistics.com/2012/04/speed-up-your-r-code-using-a-just-in-time-jit-compiler/
The post describes some advances since what Dirk wrote in his reply (several of the links in the post are actually to Dirk's newer articles regarding this topic)
I hope this help future R people searching on this topic.

Related

RStudio: My code now runs many times slower than it did before on the same computer

I'm looking for an advice please. After cca 6 months I got back to a code I wrote that by then took around 30 minutes to finish. Now, when I run it's way slower. It looks like it could take days. Since back then, hardware didn't change, I'm using Windows 10 and since then I updated my RStudio to current version (2022.07.2 Build 576), and I didn't update R version, which is "4.1.2 (2021-11-01)".
I noticed that in contrast to before, now RStudio is not using more than around 400MB RAM. Before it was much more. I don't run any other SW and there is plenty RAM available.
I had an idea that antivirus might cause this, even though I didn't change any settings. I put RStudio and R to exceptions and didn't change anything.
I also updated RStudio from the previous version, which didn't help.
Please, does anyone have an idea what can be causing this? Sorry if the description is not optimal, it's my first post here and I'm not a programmer, I just use R for data analysis for my biology related diploma thesis.
Thanks a lot!
Daniel

How Can use the Wxwidgets for plotting?

I am working as researcher at University of Genoa in Italy. I am using the C++ during my work at this Univeristy (I am new in using Visual C++). I would like to know "How can use Wxwidgets library to plot two columns from Matrix that includes on 4 columns?"
From another side, If there in any documentions that relate with Wxwidgets library that should help me to understand "How can I make plotting??", please send me the links for these documentions....
Thank you very much
There is no support for plotting in wxWidgets.
There is however number of libraries you can use located here.
One of them is wxFreeChart last updated 2010 (and so no problem with wx 2.8). SVN Version seem to show some life so its your best bet!
See the answers to this question. wxFreeChar is probably the most promising of the libraries mentioned there and should allow you to plot just about anything (I'm really not sure about what do you mean by plotting matrix columns...).

Any documentation for optimizing the performance of R? [duplicate]

This question already has answers here:
Speed up the loop operation in R
(10 answers)
Closed 9 years ago.
I'm fairly new to R, and one thing that has struck me is that it's running fairly slow. Is there any documentation for optimizing R? For example, optimizing Python is described very good here. In my particular case I'm interested in optimizing R for batch jobs.
I have tried Googling for an answer of course, but it's not exactly easy to Google for R info since R is a pretty generic little search pattern.
For start, you should take a look at R Inferno by Patric Burns.
Than the best idea is to ask more detailed questions here.
Yes, R is a bit awkward for a search term, so try RSiteSearch("performance") within R - this will search within lots of R docs sources.
a simple google search on 'efficient programming in r' reveals the following excellent resources. the first resource is great as it provides a comparison of the bad, good and best ways of programming a task in R. the second resource is more generic.
http://perswww.kuleuven.be/~u0044882/Research/slidesR.pdf
http://www.bioconductor.org/help/course-materials/2010/BioC2010/EfficientRProgramming.pdf
if you are looking at more specific areas of optimizing your R code, specify it more clearly and i am sure you will find an expert here !!
"It's running fairly slow" is very vague. There are many techniques for using R in the most efficient way, the general rule is "avoid loops, and vectorize" - but there is so much more such as ensuring objects are pre-allocated rather than resized on the fly.
It really depends on what you are doing, so please be more specific. The standard documentation has plenty of tips for the basics and your question does not really give opportunity for someone to do any more than regurgitate those.
When standard R really is limited for your needs you can write directly in a compiled language such as C, or use advanced interfaces such as Rcpp. For other tools and techniques that extend beyond the basic R toolkit consult the "High Performance Computing" Task View on CRAN.

machine learning libraries in s+ (or R)?

have been searching around the internet and stackoverflow, but haven't been able to find any information on libraries for machine learning in s-plus or R. does anyone know of any or could perhaps point me in the right direction? thank you!
You should probably start at the CRAN Task View on Machine Learning & Statistical Learning which covers the R side.
this one maybe helpful:machine learning open source software Filter by Programming Language
If your interest in ML on R includes classification and regression algorithms, then you will want to explore CARET. Be advised that, in a recent evaluation, I found the R offerings quite underwhelming when compared to the other ML OSS.

R text editors for introductory statistics courses [duplicate]

This question already has answers here:
Closed 13 years ago.
Possible Duplicates:
Best IDE / TextEditor for R
Recommendations for Windows text editor for R
Dear All,
I teach a large introductory R course (about 100 students), and would like to recommend suitable text editors for R. The students who attend this course are first year mathematics undergraduates doing their very first course in R. They have never programmed in any language before.
For the vast majority of them, it wouldn't beneficial for them to learn to use a 'complex editor' - by this I mean emacs and vi.
What I would like to do is recommend simple text editors that are
free
can be easily installed on their laptops by users with little computer knowledge
have R syntax highlighting.
available for Windows or Mac.
For windows I've found:
TINN-R
Notepad ++ with the R plugin
Are there any others that I've missed for Windows?
There are a few threads that deal with R text editors:
Best IDE / TextEditor for R
Recommendations for Windows text editor for R
Which IDE for R in Linux?
but these are a bit too complicated for my purpose.
Edits
Following comments from Shane and others I've reworded the question.
Given that you don't have an major specific requirements (like an object browser), it's probably best to use what you're already using as much as possible. Something like Textpad is very simple and can do syntax highlighting.
Here are a few more pointers:
First of all, the R console that ships with Windows has it's own script editor. Just go File > New Script. It's very easy to use and you can execute code by highlighting it. If you just want something simple, I would stick with that.
I use Eclipse (with StatET) on Windows, and I have used it on a Mac too. It's great if you want an extensive IDE (syntax highlighting, integrated console, SVN, etc.) with a small learning curve.
JGR is also very good and platform independent.
Sciviews (which has Tinn-R) has several other options, including SciViews-K which is an R extension for Komodo.
Two others worth mentioning are Rattle and Rkward.
Emacs and VIM have a bigger learning curve, but they're also very powerful, especially if you're already using them for something else.
I see, this question is distinguished from prior ones by asking for a recommendation specific to "Intro to R" students. For the Mac portion of your question, i would suggest TextMate, for two reasons. First, the default answer "just use the Aqua R.app Gui" that R ships with, has minimal syntax highlighting and doesn't allow you to save and insert R commands (not that i'm aware of at least). Both of those things make learning a new language less painful and more efficient. But that might not justify the overhead of learning an editor while learning a new language at the same time.
No doubt others here will recommend TM, but they might not mention TextMate's tiered learning curve, i.e., someone who has never seen TM before can, after a 45-min tutorial, launch an interactive R session from it and use it to save/retrieve R commands "snippets". TM is not free, but it's around $50 with academic discount i believe. I would recommend three bundles for R use in TM, (i) R.app; (ii) R.daemon; and (iii) R, all of which are in the TM svn repository.
As always, emacs is an option: R in Emacs
This may not be the best option because of the learning curve with emacs though.
I haven't used it for R but TextMate on the Mac is awesome and they have an R bundle.
I haven't used it myself, but there is an Eclipse plug-in for R (which should work on Windows and Mac).
Because someone already mentioned Emacs, of course there's VIM with R plugin, don't know how many of those there are, but I found at least one with a quick google. VIM might have an even steeper learning curve than Emacs though.
That said. I think Emacs and VIM will both handle pretty much any language out there, so let the flame war begin!
I use Vim myself but I'm quite certain that both Vim and Emacs would be a bad choice for a student course.

Resources