Getting visualizations with R
In this section, we are going to go over getting some visualizations of the data. We will create several visualizations and give short interpretations of the outcomes in them. For this, we will create two histograms in base R and a few different visuals using the ggplot2
library.
Getting the data
The first thing we need to do is load the libraries and get the data. I am working in a directory specific to this book so I can source the function directly from the chapter I wrote the read_excel_sheets()?
function in; your path might be different. Let’s look at the code up to this point:
# Library Load library(ggplot2) library(dplyr) library(healthyR) library(readxl) # Source Functions source(paste0(getwd(),"/Chapter1/excel_sheet_reader.R")) # Read data file_path <- paste0(getwd(), "/Chapter12/") df <- read_excel_sheets( Â Â filename = paste0(file_path, "diamonds_split.xlsx"),"), Â Â single_tbl...