# R Programming

## Welcome to the **R programming** Wikibook

edit
**R programming**

This book is designed to be a practical guide to the **R programming language**^{[1]}.

**R** is free software designed for statistical computing. There is already great documentation for the standard R packages on the Comprehensive R Archive Network (CRAN)^{[2]} and many resources in specialized books, forums such as Stackoverflow^{[3]} and personal blogs^{[4]}, but all of these resources are scattered and therefore difficult to find and to compare. The aim of this Wikibook is to be the place where anyone can share their knowledge and tricks on **R**. It is supposed to be organized by task but not by discipline^{[5]}. We try to make a cross-disciplinary book, i.e. a book that can be used by all people applying statistics to some specific fields.

## How can you share your R experience ?

edit- Explain the syntax of a command
- Compare the different ways of performing each task using
**R**. - Try to make unique examples based on fake data (ie simulated data sets).
- As with any Wikibook please feel free to make corrections, expand explanations, and make additions where necessary.

Some rules :

- Put the name of functions in the code environment :
`<code>lm()</code>`

- Put the name of packages in bold :
`'''stats'''`

- Except for the default packages, put the name of the package in parentheses after each function : <code>MCMCprobit()</code> ('''MCMCpack''')
- Put examples in the source environment with argument
`lang="rsplus"`

:`<syntaxhighlight lang="rsplus"></syntaxhighlight>`

- Use references to package documentations, academic literature and wikipedia.
- Use the citations templates to make citations : Template:Cite book, Template:Cite web, Template:Cite journal
- If you want to add a graph, you should load it on Commons and add the tag
`{{Created with R}}`

and, if it is applicable,`[[Category:Images with R source code]]`

.

## Prerequisites

editWe assume that readers have a background in statistics. This book is not a book about statistics but a book about how to implement statistical methods using **R**. We try to use terms which are already defined on Wikipedia such that people can refer to the corresponding wikipedia page each time they have some doubts on a notion.

We also assume that readers are familiar with computers and that they know how to use software with a command-line interface. There are some graphical user interfaces for **R** but we are not going to explain how to use them in this textbook. Beginners should have a look at the Sample session for a first session with **R**. They can also have a look at the Statistical Analysis: an Introduction using R book.

### See also

edit- Larry Wasserman's book
*All of Statistics*^{[6]} - The Statistics and the Econometric Theory wikibooks.
- The Econometrics and Statistics pages on wikipedia.

## References

edit- ↑ R Development Core Team (2009). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. ISBN 3-900051-07-0, URL http://www.R-project.org.
- ↑ CRAN manuals
- ↑ R on Stackoverflow
- ↑ See R-Bloggers
- ↑ The CRAN Task View is already organized by discipline.
- ↑ Larry Wasserman
*All of Statistics*Springer 2004 http://www.stat.cmu.edu/~larry/all-of-statistics/index.html