Table of Contents
About This Guide
The preliminary sections in this guide will be to get you started in RStudio®– how open the program, load in data, and understand the various panes that divide the page. Then, topics will be covered in roughly the order they are mentioned in the curriculum.
The majority of this guide will be largely concerned with short code snippets, showing code in a format like this
mean(labike$bike_count_pm)
## [1] 132.9
When you see this type of formatting, you can know that the top section was run in the Console (see Panes in RStudio for more information about the Console), and the results are shown on the lines designated by ##. Most times that something is shown with button clicking in the RStudio® interface, corresponding R code will be shown in this same format.
The data used in the examples shown on this wiki are from the Exploring Computer Science Unit 5 materials (available here). Most examples use the labike.csv
file, the cdc.rda
file or the CATwitter.robj
file.
What do you want to do?
- General information on how to use RStudio.
- Start examining data. Learn about the dollar sign and square brackets, make summaries (or “frequency tables”), find the length and dimension of a variable or dataset, create tables (or “contingency tables”), and determine the data type for a dataset or variable.
- Find things out about data, like how to sort data, and find descriptive statistics (like mean, median, mode, max, min).
- Learn how to put things together, using the equals sign, by creating vectors, using column- and row-binding, or transforming data.
- If you only care about a piece of the data, learn how to use the subset command, how to subset with text or do spatial subsetting.
- For geographic data, learn how to make a map, zoom in, create a spatial subset, or make a bubble chart.
- To make plots, learn about the plot command, as well as the specific ways to create (bar plots, mosaic plots, histograms, and box plots. If you want to change something about a plot, check out changing things about plots to learn how to change axis labels, add a title, change colors and symbols, rotate labels and more! If you want to use a plot in another document, learn how to save a plot.
- For text analysis, start by initializing text so R knows how to interpret it, then inspect text and process text to convert words to lower case, remove numbers, etc. To analyze your text, create a bar plot or word cloud.
- Learn how to find Help and close RStudio®, or see some Tips and Tricks or Useful Terms. If you're stuck, check out the Frequently Asked Questions page.
- Get a one-page summary of relevant R commands from R Cheat Sheet.
Video Tutorials
There are also a number of video tutorials that can help you through some of the content on this wiki. They can be found, by topic here:
All rights to RStudio® and Shiny™ are exclusive to RStudio, Inc.