R is a free software environment for statistical computing and graphics. It compiles and runs on a wide variety of UNIX platforms, Windows and MacOS.
Official site: http://www.r-project.org/index.html
The general form is
R CMD command args
where command is the name of the tool and args the arguments passed on to it.
Currently, the following tools are available.
BATCH: Run R in batch mode. Runs R –restore –save with possibly further options (see ?BATCH).
COMPILE: (UNIX only) Compile C, C++, Fortran … files for use with R.
SHLIB: Build shared library for dynamic loading.
INSTALL: Install add-on packages.
REMOVE: Remove add-on packages.
build: Build (that is, package) add-on packages.
check: Check add-on packages.
LINK: (UNIX only) Front-end for creating executable programs.
Rprof: Post-process R profiling files.
Rdconv: Rd2txt Convert Rd format to various other formats, including HTML, LaTeX, plain text, and extracting the examples. Rd2txt can be used as shorthand for Rd2conv -t txt.
Rd2pdf: Convert Rd format to PDF.
Stangle: Extract S/R code from Sweave or other vignette documentation
Sweave: Process Sweave or other vignette documentation
Rdiff: Diff R output ignoring headers etc
config: Obtain configuration information
javareconf: (Unix only) Update the Java configuration variables
rtags: (Unix only) Create Emacs-style tag files from C, R, and Rd files
open: (Windows only) Open a file via Windows’ file associations
texify: (Windows only) Process (La)TeX files with R’s style files
R CMD command --help
So if you are going to compile R program just enter:
R CMD BATCH <your R program>
- RStuidio: http://www.rstudio.org/
- StatET: http://www.walware.de/goto/statet/
- ESS: http://ess.r-project.org/
- JGR (Java GUI for R): http://cran.r-project.org/web/packages/JGR/index.html
Check out R package route, enter R shell and enter:
R install package
Method 1: Install from source
Download the add-on R package, say mypkg, and type the following command in Unix console to install it to /my/own/R-packages/:
$ R CMD INSTALL mypkg -l /my/own/R-packages/
Method 2: Install from CRAN directly
Type the following command in R console to install it to /my/own/R-packages/ directly from CRAN:
Load the library
Type the following command in R console to load the package
Steps to Build an R package
Step 1. Prepare your functions
Step 2. Build the structure of the package using
Step 3. Edit DESCRIPTION File
Step 4. Edit the help File
Step 5. Preparation for Windows Users (RTools)
Step 6. Build and install the R package
Step 7. Check the R package
Step 8. Add functions and data to a package
I’ve collected some of the basic usage of R languages on github:
Go and check it out! :) happy coding!