Metacognition
Self-assessment
Confidence
Useful
Fun
Fun
Not fear invoking
Link theory and practice
WebLean
www.
Peek Slides
Make our first data set
# Make a variable
y <- c(7,5,9,3,2)
# Take a look
print(y)
y
# Make another variable
x <- c(3,6,18,2,5)
# Fix the typo
x <- c(3,6,8,2,5)
# And one more...
id <- 1001:1005
# Mash them together to make a data set
mydata <- cbind(id,x,y) #mashing
mydata <- as.data.frame(mydata) # make it into a 'data frame'
View(mydata)
# Clean up the variables
rm(id,x,y)
# Take a look again
print(y)
# Oh no...
# Take a look at the y variable in the data frame
print(mydata$y)
Open some data
# Read data from computer (MAC)
mydata <- read.csv("~/Desktop/AAT_s1.csv")
# Read data from computer (Windows)
mydata <- read.csv("C://Users/kitd/Desktop/AAT_s1.csv")
Installing our first package
# Install package
install.packages("lme4")
# Load package
library(lme4)