Welcome. Paul Johnson's Desultory Collection of Rtips and Guidance

At the very bottom of the page, you should see the "raw" list of files and directories. Sometimes I upload things and forget to create "links" for them in this README file. If I forget, you can still find what you need at the bottom.


The official home of the new and improved Rtips is here, in pdf and "html! Rtips was my first effort to accumulate user-guide material for R, mostly because I could not remember details while translating from SAS to R. That effort started before the turn of the century, well before the world became awash in introductory guides, tip-sheets, and primer books for R.

As a joke, I used to call this "StatsRus", but I stopped because it seemed presumptuous to make "me" part of "us". But I still think it was a funny title.

WorkingExamples of R Code

The best way to learn R is to solve specific problems. In order to solve specific problems, it is necessary to isolate them and make them re-producible. In order to ask for help in the r-help email list, it is necessary to provide a self contained, focused example. (This is emphasized in the r-help email list Posting Guide). I thought that was a good idea, we did the same with the Swarm support project in the early part of this century. Thus, I have a folder "WorkingExamples". In 2013, I made some effort to rename those examples in a more organized way and the top of each one has (or will have) a little explanation.

These are things you can actually run and get smart from. The one on barplots is so incredibly awesome, you won't believe it when you see it. As my skills in R programming have improved, I notice these WorkingExamples are becoming a little more elaborate. And you will notice that, when I'm troubled about something, the examples prolifate. Look at plot-plotmath-* for example.

Vignettes from the rockchalk R package

In late 2011, I created an R package called "rockchalk". That's available on CRAN now. CRAN is for major releases, testing version is available on my server, http://rweb.quant.ku.edu/kran. (run "install.packages("rockchalk", repos="http://rweb.quant.ku.edu/kran", type = "source") to get the testing version. I work on that mainly in the Spring, when I'm teaching regression.

The rockchalk package builds on the little bits of knowledge in Rtips, and it offers some more complete regression-oriented functions to process fitted models into output for papers. Distributed with rockchalk, there is an examples folder, and there are some examples there that might help you understand R programming. In the rockchalk package's install folder, look for files "nowords-*.R" for some R programming insights.

The vignettes from rockchalk are

  1. rockchalk: A survey of fuctions in rockchalk.
  2. RStyle: A style guide for R aimed at people who have basic R user skills and need to become R programmers
  3. Rchaeology: That's a pithy name, don't you think? It includes "deep insights" and programming advice that reflects the customs and mannerisms of the R leaders.

Lectures & guides

I've re-located my lectures on R and stats and computing to this area:


Most of these are LaTeX, many are Sweaved to combine R with the document. I'm uploading everything here, the source code, anything necessary to reproduce the pdf lectures. I'm offering this as a free service, free for reuse to anybody as long as they acknowledge where they took the material.

  1. Rcourse. http://pj.freefaculty.org/guides/Rcourse. The sub-heading "Rcourse" includes the lectures that are primarily about R (apart from the statistical background)
  2. stat. http://pj.freefaculty.org/guides/stat. Stats lectures, most of which use R and Sweave. The primary emphasis is on statistical applications and interpretation. The difference between the two is sometimes hard to describe (its mostly audience dependent).
  3. Computing-HOWTO. http://pj.freefaculty.org/guides/Computing-HOWTO

Sweave Tutorial

During the Stats Camp at University of Kansas, a "camper" asked me for help in learning how to use Sweave. I've uploaded some notes, SweaveTutorial, which shows the bare minimum steps needed to use Sweave and then some details I add. Please read firstTry.pdf in there, the Rnw and tex files are in same folder. Once you learn the ins-and-outs, then read secondTry.pdf.

I have a "LaTeX Get Started" document in the guides directory (read below). http://pj.freefaculty.org/guides/Computing-HOWTO/LatexAndLyx


I found myself walking through the same installs over and over with Windows users. So I made these screencasts to give people a head start. I don't hold these out as great production quality, but they do reflect a nearly week-long battle with a Windows 8 virtual machine, CamStudio, the hosts audio/video system. Its very tricky to keep the video and audio synced.

  1. StartR 01-Install R for Windows and ActivePerl
  2. http://youtu.be/pmK9bWG1ftk

    On a Windows 8 system, this demonstrates the R installation, basic usage, as well as the importation of an Excel spreadsheet using the gdata package's read.xls function, with the support of ActivePerl. Part 2 in this series discusses better editors for code preparation: http://youtu.be/lNlJFEpdytc

  3. StartR 02-Editors for R in Windows: Emacs (ESS), RStudio, Notepad++
  4. http://youtu.be/lNlJFEpdytc

    Installing and using programmer's file editors to interact with an R session. Demonstrates the installation, configuration, and usage to offer the viewer a clear view of what these editors offer. This is important because the editor provided with R for Windows does not offer conveniences for coders. This is the second presentation in a series, please view the first one, StartR 01, which is about installing R, ActivePerl, and R packages. http://youtu.be/pmK9bWG1ftk

PJ, 2013-05-31