Data, Code & RStudio

Lab 1A

Directions: Follow along with the slides and answer the questions in red font 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

Type the following commands into the console

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

function (y~x, data = ____ )
histogram(~height, data = cdc)
bargraph(~drive_text, data = cdc)
xyplot(weight~height, data = cdc)

On your own: