Sunday, April 7, 2013

Top 10 tips to get started with R

(This article was first published on mages' blog, and kindly contributed to R-bloggers)

  1. Be motivated. R has a steep learning curve. Find a problem you can't solve otherwise. E.g. plotting multivariate data, a statistical analysis for which an R function exists already.
  2. Download and install R. Get to know the R console. Learn how to install additional packages, how to access the history, how to use auto completion and open the help system. Review the R Installation and Administration manual and check out the free books section on CRAN. 
  3. Get familiar with the R help files. They can appear cryptic at the start, but there is a structure to them. Read and re-read a couple of help files again and again. Look out for the input and output sections, execute the examples, run the demos, e.g.demo(graphics). Subscribe to R-help and read questions and answers, check outstackoverflow, follow blogs. Search with Rseek.org
  4. Learn how to get your data into R. The easiest way is usually via a CSV-file (CSV=comma separated values), using read.csv. Look into XLConnect, if you have to deal with spreadsheet files. Move on to write queries against data bases, e.g. using RODBC. Skim through the R Data Import/Export manual. 
  5. Try to understand the different data types in R and how to modify them. What are the differences between a matrix and a data frame? What is a factor? What is a list? Think about the different use cases. Review the Introduction to R manual.
  6. Do charts! Lots of charts. They are rewarding and keep you motivated. Be inspired by the R Graph Gallery. Check out the following packages: latticeplotrixggplot2,deducergoogleVis.
  7. Learn how you can modify and reshape data in R and apply functions on subsets using by, apply, lapply, avereshapesweep, with, within, etc. Set aside a weekend to think about these functions. 
  8. Write your R code into files instead of typing it all into the R console. Use anintegrated development environment (IDE), e.g. ESS EmacsRStudioStatET Eclipse.
  9. Understand the concept of functions. Write a function, which gives "Hello World" back. Modify it, so it has an input argument NAME and it prints "Hello NAME". Review the code of existing R functions. Copy from existing code.
  10. Document your code! Start your code by explaining what you want to achieve and only code that much, then write down the next step in plain English and code again. How will you know that your code does what you want it to do? Testing can help. Think your about your code style and how you will be versioning your files.

Bonus tip


To leave a comment for the author, please follow the link and comment on his blog:mages' blog.
R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2Boxplotsmapsanimation), programming (RStudioSweaveLaTeX,SQLEclipsegithadoopWeb Scraping) statistics (regressionPCAtime series,ecdf,trading) and more...

Tuesday, February 26, 2013

Statistics for the Social Sciences

страничка jfox at mcmaster.ca на кране
с короткими рекомендациями
любопытно, что этому блогу уже больше 2х лет, начал 3 февраля 2011

Monday, February 25, 2013

couple of resources

Rob Kabacoff's Quick-R accessing the power of R, and
RDataMining.com: R and Data Mining

still does not work

Это про Rcmdr
Удалось установить только RStudio, a кроме упомянутого Rcmdra ещё хочу Rattle, который тоже не встаёт :(

вопросы задавал в ЖЖ и
в LinkedIn
ответы есть, но, тем не менее, воз и ныне там, а нужда уже подпирает

устанавливал по оригинальной инструкции, есличо