Local tips for R
|
Back to statistics
http://www.psychol.cam.ac.uk/statistics/R/
|
These pages provide a few short guides to getting going with R, a free statistical package.
- Installation.
- Obtaining a graphical user interface (GUI).
- At this point, I suggest you read the short guide by Owen (2007), The R Guide, in its entirety. This covers basic data entry, maths, and some statistics.
- Basics of R objects; entering and manipulating data.
- Input and output: scripts, saving and loading data (including database access).
- Basic statistics.
- Analysis of variance (ANOVA).
- Basic graphs (1).
- Basic graphs (2, with ggplot2).
- Graphs 3: more examples.
- Handy extensions to R.
Note some general points:
- Use q() to quit.
- Use help.search("keyword") or apropos("keyword") to find stuff in R.
- Use ?keyword for help on a particular topic.
- Use install.packages() to install new R packages (via a graphical interface), or install.packages("package").
- Use functionname (a function name without the usual brackets) to view the source code for a function. If this just shows a UseMethod call (e.g. try this for wilcox.test), then use methods(...) (e.g. methods(wilcox.test) ). That may show you a list of functions, including some non-visible ones. To see their source, use getAnywhere(...) (e.g. wilcox.test.default is listed, so use getAnywhere('wilcox.test.default') ).
- Press CTRL-L to clear the screen.
Typographical conventions used here:
# This is code (stuff you type into R). Hashes (#) indicate comments.
This is output (stuff that R shows you).
/* This is SPSS syntax (stuff you type into SPSS), for comparison to R. */
Other excellent introductions to R on the web include:
- Owen (2007) The R Guide.
- Quick-R (particularly aimed at users migrating from other statistical packages)
- An Introduction to R (from the R web site)
- Faraway JJ (2002) Practical Regression and ANOVA in R.
- Revelle W (2008) Using R for psychological research.
- Baron J & Li Y (2007) Notes on the use of R for psychology experiments and questionnaires.
- William Revelle's short list of the most useful R commands.
- Dong-Yun Kim's Statistical Computing with R: A Tutorial.
For other specific things:
- Glynn EF (2007) Using Color in R
Reference sources (less readable!), include:
- R Data Import/Export (from the R web site)
- The R Language Definition (more technical; from the R web site)
- The full set of R manuals (from the R web site)
没有评论:
发表评论