Skip to content

Instantly share code, notes, and snippets.

View aravindhebbali's full-sized avatar
🏠
Working from home

Aravind Hebbali aravindhebbali

🏠
Working from home
View GitHub Profile
@aravindhebbali
aravindhebbali / viz_intro.R
Last active September 26, 2017 06:57
Data Visualization: Introduction
# help
help(plot)
help(mtcars)
# mtcars
head(mtcars)
# variable info
str(mtcars)
@aravindhebbali
aravindhebbali / gg_themes.R
Last active November 15, 2017 18:22
ggplot2: Themes
# install
install.packages('ggplot2')
install.packages('readr')
# load
library(ggplot2)
library(readr)
# Scatter Plot
p <- ggplot(mtcars) +
@aravindhebbali
aravindhebbali / gg_facet.R
Last active September 25, 2017 15:06
ggplot2: Facets
# install
install.packages('ggplot2')
install.packages('readr')
# load
library(ggplot2)
library(readr)
# import data
ecom <- readr::read_csv('https://raw.githubusercontent.com/rsquaredacademy/datasets/master/web.csv')
@aravindhebbali
aravindhebbali / gg_stats.R
Last active September 25, 2017 15:01
ggplot2: Statistical Plots
# install
install.packages('ggplot2')
install.packages('readr')
# load
library(ggplot2)
library(readr)
# import data
ecom <- readr::read_csv('https://raw.githubusercontent.com/rsquaredacademy/datasets/master/web.csv')
@aravindhebbali
aravindhebbali / gg_overlap.R
Last active September 25, 2017 14:50
ggplot2: Overlapping
# install
install.packages('ggplot2')
install.packages('readr')
# load
library(ggplot2)
library(readr)
# Dodge
ggplot(data = mtcars, aes(factor(cyl), fill = factor(vs))) +
@aravindhebbali
aravindhebbali / gg_leg_part_6.R
Last active September 25, 2017 14:42
ggplot2: Legends - Part 6
# install
install.packages('ggplot2')
install.packages('readr')
# load
library(ggplot2)
library(readr)
# Legend Title
ggplot(mtcars) + geom_point(aes(disp, mpg, color = factor(cyl))) +
@aravindhebbali
aravindhebbali / gg_leg_part_5.R
Last active September 25, 2017 14:31
ggplot2: Legends - Part 5
# install
install.pacakges('ggplot2')
install.packages('readr')
# load
library(ggplot2)
library(readr)
# Plot
ggplot(mtcars) +
@aravindhebbali
aravindhebbali / gg_leg_part_4.R
Last active September 25, 2017 14:19
ggplot2: Legends - Part 4
# install
install.packages('ggplot2')
install.packages('readr')
# load
library(ggplot2)
library(readr)
# Plot
ggplot(mtcars) +
@aravindhebbali
aravindhebbali / gg_leg_part_3.R
Last active September 25, 2017 10:57
ggplot2: Legends - Part 3
# install
install.packages('ggplot2')
install.packages('readr')
# library
library(ggplot2)
library(readr)
# Plot
ggplot(mtcars) +
@aravindhebbali
aravindhebbali / gg_leg_part_2.R
Last active September 25, 2017 10:47
ggplot2: Legends Part - 2
#install
install.packages('ggplot2')
install.packages('readr')
# library
library(ggplot2)
library(readr)
# Plot
ggplot(mtcars) +