Data, Code & RStudio

Lab 1A

Directions: Follow along with the slides and answer the questions in red font in your journal.

Welcome to the labs!

So let’s get started!

data(cdc)
View(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 = ____ )

Syntax in action

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

On your own: