background preloader

R

Facebook Twitter

The igraph library for complex network research. An Introduction to R. Table of Contents This is an introduction to R (“GNU S”), a language and environment for statistical computing and graphics.

An Introduction to R

R is similar to the award-winning1 S system, which was developed at Bell Laboratories by John Chambers et al. It provides a wide variety of statistical and graphical techniques (linear and nonlinear modelling, statistical tests, time series analysis, classification, clustering, ...). This manual provides information on data types, programming elements, statistical modelling and graphics. This manual is for R, version 3.1.0 (2014-04-10). Copyright © 1990 W. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Preface This introduction to R is derived from an original set of notes describing the S and S-PLUS environments written in 1990–2 by Bill Venables and David M. Comments and corrections are always welcome. Suggestions to the reader 1.1 The R environment Try ?

Kickstarting R. Kickstarting R - Writing R scripts So what is an R script?

Kickstarting R

An R script is simply a text file containing (almost) the same commands that you would enter on the command line of R. (almost) refers to the fact that if you are using sink() to send the output to a file, you will have to enclose some commands in print() to get the same output as on the command line. To run a script, let's say one with the name: /home/jim/psych/adoldrug/partyuse1.R you may either use: source("/home/jim/psych/adoldrug/partyuse1.R") on the command line of R OR R CMD BATCH /home/jim/psych/adoldrug/partyuse1.R Let's pause to note a little historical bifurcation that has caused almost as much strife as the question of exactly what the <Delete> key should do.

I would have to refer to it as: in an R script. Using the script to determine where things happen Managing the various objects used in R can be challenging. First, choose your directory. Annotating the output file R's output can often be terse. Viewing and saving plots. R help archive: Re: [R] Barplot legend position. Generating a Call Graph in R. R Data Import/Export. [R-sig-Geo] writeRaster problems. How to execute R script piece by piece on SSH terminal. Homepage of Johannes Ranke. The vim R plugin for Linux/Unix was inspired by a Lisp plugin for vim and was first published on www.vim.org in July 2004.

Homepage of Johannes Ranke

The plugin works by starting R via a perl script in an xterm. This instance of R listenes for input both directly from the xterm as well as from a pipe that you can send code to from a vim instance. Screenshots Here you can see my usual setup with two xterms: On the left, an R script is edited. Note that folded code can also comfortably be visually selected and sent over for execution.

Installation and setup On Debian GNU/Linux, and supposedly on distributions derived from Debian such as Ubuntu, simply install the package vim-r-plugin from my Debian repository. If you use Debian sid or a Debian based distribution with a vim version greater than 7.1-022+1, you need to activate the plugin after installation, using the vim-addons command.

In addition, current Debian vim packages don't have filetype plugins enabled by default, so you have to enable them. Platforms. DoMPI.pdf - Powered by Google Docs.