2012年10月23日星期二

R tips




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.
  1. Installation.
  2. Obtaining a graphical user interface (GUI).
  3. 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.
  4. Basics of R objects; entering and manipulating data.
  5. Input and output: scripts, saving and loading data (including database access).
  6. Basic statistics.
  7. Analysis of variance (ANOVA).
  8. Basic graphs (1).
  9. Basic graphs (2, with ggplot2).
  10. Graphs 3: more examples.
  11. 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:
For other specific things:
Reference sources (less readable!), include:

没有评论:

发表评论