CSoI Life Sciences Workshop (June 22-26, 2015)
R Project for Statistical Computing
Also download RStudio.
- click the download R link
- choose a mirror
- choose your platform
There are now many, many books and resources for R.
Some of my favorites for getting started are listed here.
There is a longer list on the R project site, here.
List of datasets that are built into R:
Type ?datasets and then click the Index at the bottom of the page,
or type data() to see the list.
Some example code
- vectors and recycling code
- why for loops are slow code
- dice example code
- generating normally distributed values code
- basics about NA's code
- how to make seq's code
- how to make rep's code
- ways to index vectors code
- how to build a function code
- introduction to matrices code
- more examples with matrices code
- one more matrix example code
R has several kinds of data types.
We can do most of what we need with just scalars, vectors, factors, and data frames:
- scalar (can be logical, integer, double, complex, character, raw, and a few others...)
- vector (1 dimensional), matrix (2 dimensional), and array (multidimensional)
- factor (ordered sequence of data; the possible values are called levels)
- data frame (two dimensional data structure, where each column has the same length but different columns can have different types of data)
- list (an ordered collection of objects)
- formulas (used to show how variables are related)
- time series (data collected at several (usually uniform) points in time)
- shingles (typically used in lattice)
- dates and times
- connections (these allow R to communicate outside of the R platform)
examples from Monday afternoon
introduction to image analysis