# Run this code to load the required packages
suppressMessages(suppressWarnings(suppressPackageStartupMessages({
library(mosaic)
library(supernova)
library(Lock5withR)
})))
# Adjust the plots to be a bit smaller
options(repr.plot.width = 6, repr.plot.height = 4)
CensusSchool <- read.csv("https://docs.google.com/spreadsheets/d/e/2PACX-1vSVaWnM4odSxy0mlnhWvvGbeLtiKoZmsbqC6KLzXtBOjQfrF9EVKuX4RVh3XbP3iw/pub?gid=2100178416&single=true&output=csv", header = TRUE)
str(CensusSchool)
CensusSchool <- read.csv("https://docs.google.com/spreadsheets/d/e/2PACX-1vSVaWnM4odSxy0mlnhWvvGbeLtiKoZmsbqC6KLzXtBOjQfrF9EVKuX4RVh3XbP3iw/pub?gid=2100178416&single=true&output=csv", header = TRUE)
head(CensusSchool)
select(CensusSchool, Doing_Homework_Hours, Schoolwork_Pressure)
# Does the number of hours spent on homework have an impact pressure on a student?
filter(CensusSchool,Doing_Homework_Hours<= 25,Doing_Homework_Hours> -1)-> CensusSchool2
gf_histogram(~Doing_Homework_Hours,data= CensusSchool2, fill = "blue", color = "black") %>% gf_facet_grid(Schoolwork_Pressure ~.)
CensusSchool2 <- select(CensusSchool2, Doing_Homework_Hours, Schoolwork_Pressure)
CensusSchool2 <- filter(CensusSchool2, Doing_Homework_Hours != "NA", Schoolwork_Pressure !="NA")
filter(CensusSchool2,Doing_Homework_Hours<= 25,Doing_Homework_Hours> -1)-> CensusSchool2
gf_histogram(~Doing_Homework_Hours,data= CensusSchool2, fill = "pink", color = "black")
gf_bar(~ Schoolwork_Pressure, data = CensusSchool2) -> bargraph1
bargraph1+coord_flip ()
lm(Doing_Homework_Hours ~ Schoolwork_Pressure, data = CensusSchool2)
lm(Doing_Homework_Hours ~ Schoolwork_Pressure, data = CensusSchool2)->CensusSchool2.
supernova(CensusSchool2.)