coding beacon

[programming & visualization]

Tag Archives: links

RRRR: Relevant R-Related References

R_in_Eclipse1_quantmod
you can see this & more by running “demo(chartSeries, package = “quantmod”, ask = TRUE)” w/o quotes
(install.packages(“quantmod”) if you haven’t got that package)
 

Why use R

Pro’s: http://www.inside-r.org/why-use-r
Cons (when Matlab / Scilab are better): http://zoonek2.free.fr/UNIX/48_R/01.html (and even then, I would use non-R tools for prototyping only)

Start here:

Installation:

RStudio: (++installs in one simple step, ++RMarkdown notebooks, ++actively developed, ++no java dependency, –a bit more rigid IDE than Eclipse)

[1] Get R: http://cran.r-project.org/
[2] Get RStudio:http://www.rstudio.com/

Update: I switched from Eclipse to RStudio since I posted this.

Eclipse + StatET: (++extremely flexible IDE, –java dependency, –long first set-up time 20-min-to-1-hour, –one-person-project, –few updates)

[1] Get R (same link as [1] above): http://cran.r-project.org/
[2] Get rj package from within R command line interface: http://www.walware.de/it/rj/installation.mframe?jump=rpkg-installation
[3] http://www.eclipse.org/downloads/ (Eclipse: most flexible IDE, version recommended for R users: “Eclipse IDE for Java Developers”)
[4] http://www.walware.de/goto/statet (StatET: Eclipse R plugin, install within R!)
[5] Set up “Run Configuration” as described

The R Commander:

[1] This is worth having a look at if you need a simple yet powerful GUI: http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/#menu
[2] Get it here: http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/

Running R demos (many packages have them):

Run the following command after installing R:
demo(graphics, package = “graphics”, ask = TRUE)
To see all available demos, run
demo()
or
demo(package = .packages(all.available = TRUE))

Using R / Quick Intro(s) to R:

http://faculty.washington.edu/gyollin/AMATH463.php

On colors / graphical parameters

[1] http://research.stowers-institute.org/efg/R/Color/Chart/index.htm
[2] http://www.statmethods.net/advgraphs/parameters.html

Getting Around Eclipse StatET

Opening Multiple R Graphics Panes:
AdditionalRGraphView1

Then you need to know the following dev.xxx() functions to choose which window (device) to use to plot your graphics. Only one device is the active device. This is the device in which all graphics operations occur. Most of the following are self explanatory (or use the “?command_name” to get help).

dev.cur()
dev.list()
dev.next(which = dev.cur())
dev.prev(which = dev.cur())
dev.off()  #shuts down the specified (by default the current)
dev.off(which = dev.cur())
dev.set(which = dev.next())  #makes the specified device the active device
graphics.off() #shuts down all open graphics devices.

Graph Generation Via Automated StatET’s Support of GGPlot2:
Menu: [ R ] -> [ New Graph (‘ggplot2’)” ]
StatET automatically generates appropriate R code based on the following forms.
ggplot2_automation1

R Tips and Tricks

Tip: If R is not your first programming language, a very fast way of getting to know functions of ANY package is just typing a name of a function and running it. The console will display the code for that function.

Organizing R Source Code: http://stackoverflow.com/questions/1266279/how-to-organize-large-r-programshttp://stackoverflow.com/questions/2284446/organizing-r-source-code

How to include (source) R script in other scripts: http://stackoverflow.com/questions/6456501/how-to-include-source-r-script-in-other-scripts

Google’s R Style Guide: https://google-styleguide.googlecode.com/svn/trunk/Rguide.xml

Writing R Extensions:  http://cran.r-project.org/doc/manuals/R-exts.pdf

Dirty Tricks (book): http://zoonek2.free.fr/UNIX/48_R/02.html#17

Sourcing files using a relative path: http://stackoverflow.com/questions/12048436/r-sourcing-files-using-a-relative-path?rq=1

R References & Resources

Stackoverflow covers most (if not all the topics, incl. references to other sites): http://stackoverflow.com/tags/r/info

must-read intro: http://cran.r-project.org/doc/manuals/r-release/R-intro.html

important excerpt from the intro: http://cran.r-project.org/doc/manuals/r-release/R-intro.html#Object-orientation

this is huge: http://zoonek2.free.fr/UNIX/48_R/01.html

R-inside community: http://www.inside-r.org/

Using R for Time Series Analysis: http://a-little-book-of-r-for-time-series.readthedocs.org/en/latest/src/timeseries.html

Robust workflow for replicability and reliability with Eclipse + StatET https://web.stanford.edu/~messing/ComputationalSocialScienceWorkflow.html

Interactive graphics

http://www.rosuda.org/iPlots/
http://www.ggobi.org/
http://www.statmethods.net/advgraphs/interactive.html
 (includes some of the above links)

R-Related Blogs

http://onertipaday.blogspot.com.tr/2007/06/r-number-output-format.html

http://your-new-head.com/2013/12/02/best-ide-for-r-rstudio-vs-statet/ (StatET is better for working with Shiny)

Useful Links on C/C++ Programming