Remind students to install R and RStudio.

Have students open RStudio and check to see if console “sees” R.

R

RStudio

Create new folder for scripts

Basic expressions

50
50 / 1000
50 / 1000 * 2.2
50
50 / 1000
50 / 1000 * 2.2

Create notes R script, put in new folder

Variables

weight_g <- 50
weight_g / 1000
weight_g / 1000 * 2.2
weight_lb = weight_g / 1000 * 2.2
weight_g
weight_g * 2
weight_g
weight_g <- 26
weight_g

Comments

# Calculate weight of Kangaroo Rat in pounds

Assignments format

# Problem 1

# 1.1
2 + 2

# 1.2
2 - 8

# Problem 2

width = 2
height = 3
length = 1.5
volume = width * height * length
volume

Create assignment script, put in new folder

Do Exercise 1.1-1.3 - Basic Expressions

Do Exercise 2 - Basic Variables

Functions

sqrt(weight_lb)
sqrt(0.11)
round(0.11, 1)
round(weight_lb, 1)
weight_rounded <- round(weight_lb, 1)
weight_rounded

Do Exercise 4.1-4.3 - Built-in Functions

mass_kg <- 0.5163
round(mass_kg, 2)
mass_kg

Types

str(weight_lb)
str('hello world')