The R language is often initially taught focusing on its built-in functions. Later, beginners discover that there are add-on packages that make R *much* easier to use. This workshop does just the opposite: it starts using the easiest and fastest R commands right from the start. For each topic, it then covers the built-in functions briefly, pointing out why we will focus on an alternative. There are, of course, situations in which some of the built-in functions are the best to use, and we’ll go over those as well.

Most of our time will be spent working through examples that you may run simultaneously on your computer. You will see both the instructor’s screen and yours, as we run the examples and discuss the output. However, the handouts include each step and its output, so feel free to skip the computing; it’s easy to just relax and take notes. The slides and programming steps are numbered so you can easily switch from computing to slides and back again.

This workshop is available at your organization’s site, or via webinars.

The 0n-site version is the most engaging by far, generating much discussion and occasionally veering off briefly to cover topics specific to a particular organization. The instructor presents a topic for around twenty minutes. Then we switch to exercises, which are already open in another tabbed window. The exercises contain hints that show the general structure of the solution; you adapt those hints to get the final solution. The complete solutions are in a third tabbed window, so if you get stuck the answers are a click away. The typical schedule for training on site are located here.

A webinar version is also available. The approach is saves travel expenses and is especially useful for organizations with branch offices. It’s offered as two half-day sessions, often with a day or two skipped in between to give participants a chance to do the exercises and catch up on other work. There is time for questions on the lecture topics (live) and the exercises (via email). However, webinar participants are typically much less engaged, and far less discussion takes place.

For further details or to arrange a webinar or site visit, contact the instructor, Bob Muenchen, at muenchen.bob@gmail.com.

**Prerequisites**

This workshop assumes no prior knowledge of R. Some knowledge of statistics is helpful, but not required. The instructor is well aware that knowledge of statistics fades rapidly when not used!

**Learning Outcomes**

When finished, participants will be able to use R to import data, transform it, create publication quality graphics, perform commonly used statistical analyses and know how to generalize that knowledge to more advanced methods.

**Presenter**

Robert A. Muenchen is the author of *R for SAS and SPSS Users* and, with Joseph M. Hilbe, *R for Stata Users*. He is also the creator of r4stats.com, a popular web site devoted to analyzing trends in analytics software and helping people learn the R language. Bob is an ASA Accredited Professional Statistician™ with 35 years of experience and is currently the manager of OIT Research Computing Support (formerly the Statistical Consulting Center) at the University of Tennessee. He has taught workshops on research computing topics for more than 500 organizations and has offered training in partnership with the American Statistical Association, DataCamp.com, New Horizons Computer Learning Centers, Revolution Analytics, RStudio and Xerox Learning Services. Bob has written or coauthored over 70 articles published in scientific journals and conference proceedings, and has provided guidance on more than 1,000 graduate theses and dissertations.

Bob has served on the advisory boards of SAS Institute, SPSS Inc., StatAce OOD, Intuitics, the Statistical Graphics Corporation and PC Week Magazine (now eWeek). His suggested improvements have been incorporated into SAS, SPSS, JMP, STATGRAPHICS and several R packages. His research interests include statistical computing, data graphics and visualization, text analytics, and data mining.

**Computer Requirements**

On-site training is best done in a computer lab with a projector and, for large rooms, a PA system. The webinar version is delivered to your computer using Zoom (or similar webinar systems if your organization has a preference.)

Course programs, data, and exercises will be sent to you a week before the workshop. The instructions include installing R, which you can download R for free here: http://www.r-project.org/. We will also use RStudio, which you can download for free here: http://RStudio.com. If you already know a different R editor, that’s fine too.

**Course Outline
**(In-depth data management topics are covered in an optional separate workshop that usually follows immediately after this one.)

- Introduction and statement of goals
- Overview of R
- Installing and maintaining R
- Getting help

- Programming Language Basics – including creating, subsetting and analyzing:
- Vectors (variables)
- Factors (categorical variables)
- Data frames (data sets)
- “Tibbles” (dplyr’s tbl_df data frames)
- Matrices
- Arrays
- Lists

- Managing your files and workspace
- Listing their names
- Printing
- Deleting
- Saving
- Examining structure of data sets, etc.

- Controlling functions (procedures or commands) using
- Arguments (options or parameters)
- An object’s class
- How to change class
- Model formulas

- Data Acquisition – Reading files (includes whichever formats your organzation needs)
- Comma separated value files
- Tab-delimited files
- Excel files
- Minitab data sets
- SAS data sets
- SPSS save file
- Stata data sets

- Data Transformations using
- Math formulas
- Recoding
- Conditional (logical) formulas

- Selecting variables and observations using:
- Dollar format
- The “attach” function
- The “with” function
- Subscripting (a.k.a. indexing)
- dplyr’s select and filter functions
- Model formulas and the “data=” argument

- Writing functions (macros)
- Why they’re more important in R than most languages
- How to create functions
- How to apply functions to data frames
- Applying functions by group

- Graphics
- Traditional graphics including:
- Bar charts
- Scatter plots
- Strip plots
- Box plots
- Histograms
- Repeating above plots by groups
- Adding titles, etc.
- Adding regression lines

- Lattice graphics – a brief overview
- The Grammar of Graphics approach using the ggplot2 package
- qplot vs. ggplot
- Bar charts
- Histograms
- Scatter plots
- Strip plots
- Multi-layered plots
- Group plots
- Adding titles, etc.
- Adding regression lines

- Interactive graphics – a brief overview
- Graphics resources

- Traditional graphics including:
- Statistics – many are done showing sparse R output and the richer output that most people prefer.
- Descriptive statistics
- Crosstabulation with chi-squared test
- Repeating an analysis by groups or departments (a.k.a. “By” or “split file”)
- Correcting p-values for the effects of multiple testing
- Correlation: Pearson, Spearman
- Linear regression
- Extractor functions (a.k.a. postestimation commands)
- T-tests
- Wilcoxon Mann-Whitney rank sum test
- Paired t-test
- Wilcoxon signed-rank test
- Analysis of variance
- Kruskal-Wallis
- Post hoc tests

- Getting publication-quality output into
- Word
- HTML
- LaTeX (optional)

- Ways to run R (includes only those of interest to your organization)
- Interactively
- Programs that include other programs
- Running R from within SAS
- Running R from within SPSS
- Running R as an adjunct to Stata
- Graphical User Interfaces:
- R Commander
- Rattle data mining interface
- Excel integration
- Alteryx/KNIME/RapidMiner

- Summary of topics learned

Here is a slide show of previous workshops.