Data, Code & RStudio

Lab 1A

Directions: Follow along with the slides, completing the questions in blue on your computer, and answering the questions in red in your journal.

Space, Click, Right Arrow or swipe left to move to the next slide.

Welcome to the labs!

So let’s get started!

data(cdc)
View(cdc)
?cdc

Data: Variables & Observations

Uncovering our Data’s Structure

Some new functions

dim(cdc)
nrow(cdc)
ncol(cdc)
names(cdc)

First Steps

Syntax matters

Names(cdc)
NAMES(cdc)
names(cdc)
names(CDC)

R’s most important syntax

function(y ~ x, data = ___)
bargraph(~grade, data = cdc)

Syntax in action

histogram(~height, data = cdc)
bargraph(~drive_text, data = cdc)
xyplot(weight~height, data = cdc)

On your own