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 / gg_leg_part_1.R
Last active September 25, 2017 10:29
ggplot2: Legends - Part 1
# install
install.packages('ggplot2')
install.packages('readr')
# library
library(ggplot2)
library(readr)
# Basic Plot
ggplot(mtcars) +
@aravindhebbali
aravindhebbali / gg_axes_guide.R
Last active September 25, 2017 10:20
ggplot2: Guides - Axes
# install
install.packages('ggplot2')
install.packages('readr')
# load
library(ggplot2)
library(readr)
# X Axis - Continuous
ggplot(mtcars) +
@aravindhebbali
aravindhebbali / gg_hist.R
Last active September 25, 2017 10:09
ggplot2: Histogram
# install
install.packages('ggplot2')
install.packages('readr')
# library
library(ggplot2)
library(readr)
# import data
ecom <- readr::read_csv('https://raw.githubusercontent.com/rsquaredacademy/datasets/master/web.csv')
@aravindhebbali
aravindhebbali / gg_box.R
Last active September 25, 2017 09:59
ggplot2: Box Plot
# install
install.packages('ggplot2')
install.packages('readr')
# library
library(ggplot2)
library(readr)
# import data
ecom <- readr::read_csv('https://raw.githubusercontent.com/rsquaredacademy/datasets/master/web.csv')
@aravindhebbali
aravindhebbali / gg_bar.R
Last active September 25, 2017 09:47
ggplot2: Bar Plot
# install
install.packages('ggplot2')
install.packages('readr')
# library
library(ggplot2)
library(readr)
# Simple Bar Plot
ggplot(ecom) +
@aravindhebbali
aravindhebbali / gg_line.R
Last active September 25, 2017 09:40
ggplot2: Line Charts
# install
install.packages('ggplot2')
install.packages('readr')
# library
library(ggplot2)
library(readr)
# import data
gdp <- readr::read_csv('https://raw.githubusercontent.com/rsquaredacademy/datasets/master/gdp.csv')
@aravindhebbali
aravindhebbali / gg_scatter.R
Last active September 25, 2017 09:33
ggplot2: Scatter Plots
# install
install.packages('ggplot2')
install.packages('readr')
# library
library(ggplot2)
library(readr)
# Basic Plot
ggplot(mtcars) +
@aravindhebbali
aravindhebbali / gg_annotate.R
Last active September 25, 2017 09:22
ggplot2: Text Annotations
# install
install.packages('ggplot2')
install.packages('readr')
# library
library(ggplot2)
library(readr)
# Add Text
ggplot(mtcars) +
@aravindhebbali
aravindhebbali / gg_aesthetics.R
Last active September 25, 2017 08:39
ggplot2: Aesthetics
# install
install.packages('ggplot2')
install.packages('dplyr')
install.packages('tidyr')
install.packages('readr')
# library
library(ggplot2)
library(dplyr)
library(tidyr)
@aravindhebbali
aravindhebbali / gg_geoms.R
Created September 25, 2017 08:21
ggplot2: Geoms
# install
install.packages('ggplot2')
install.packages('dplyr')
install.packages('readr')
install.packages('tibble')
# library
library(ggplot2)
library(dplyr)
libary(readr)