[1] 23.8
[1] 23.8
5/24/23
setwd("/path/to/your/folder")
sum()
, mean()
, min()
, max()
, sqrt()
c()
x <- 1:3
Types of Objects in R
Summarizing Data in One Variable
Working with Real Data in R
Summarizing Data in One Variable
Working with Real Data in R
Integers int
type
Doubles
Ways of Summarizing (Univariate):
summary()
functionsummary()
function
x %>% function()
mutate()
to create and change column(s)Character chr
data
Factors
Ways of Summarizing (Univariate):
factor()
factor(variable, levels = c(...), labels = c(...))
[1] "A" "A" "A" "B" "B" "B" "B" "B" "B" "C" "C" "C" "C" "C" "C" "C" "C"
table()
Download 2020 House elections results from Courseworks
Put file into course folder
Set working directory in R or open course RProject
Read file into R using tidyverse:
Types of Data in R
Working with Data in R
Introduction to R