knitr::opts_knit$set(root.dir = rprojroot::find_rstudio_root_file()) # Set WD to Root here::i_am("lab_mod/ch4-classification-lab.Rmd") library(tidyverse) library(here) library(ISLR2) library(GGally)
glimpse(Smarket)
skimr::skim(Smarket)
Smarket %>% GGally::ggpairs(aes(color = Direction), upper = list(continuous = "density", combo = "box_no_facet"), lower = list(continuous = "points", combo = "dot_no_facet"), alpha = 0.4, title = "Smarket Data" ) lbr::ggsave_mac(here("plot/Smarket_ggpairs.png"))
png(here("plot/Smarket_pairs.png"), width = lbr::fig.mac$wd, height = lbr::fig.mac$ht, units = "in", res = 320) pairs(Smarket, col = Smarket$Direction) dev.off()
glm.fits <- glm( Direction ~ Lag1 + Lag2 + Lag3 + Lag4 + Lag5 + Volume, data = Smarket, family = binomial ) summary(glm.fits)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.