# BS1033 Lecture 1 Analysis Part 1
# Author: Chris Hansman
# Email: [email protected]
# Date : 11/01/21
#Project Automatically Sets the Directory!!
#getwd()
# Installing Packages and Loading Libraries
install.packages(tidyverse)
library(tidyverse)
# How I would do the Menti:
ols_basics<-read_csv(“ols_basics.csv”) #Reading OLS Dataols_v1 <- lm(Y~X, data=ols_basics) #Estimating OLS Regressionsummary(ols_v1) #Examining Output#tidy datatable1#non-tidy data (example 1)table2#Spreading to make tidytidy2 <- table2 %>%
spread(key=type, value=count)
#non-tidy data (example 2)
table4a
#Gathering to make tidy
tidy4a <- table4a %>%
gather(1999, 2000, key = year, value = cases)
#The pipe operator
x <-sqrt(exp(log(9)))y <- 9 %>%
log() %>%
exp() %>%
sqrt()
Reviews
There are no reviews yet.