Tags » Ggplot2

A map of the US election results

  1. Upload libraries:
rm(list = ls(all=T)) #clear workspace
library(dplyr)
library(readr)
library(stringr)
library(tidyr)
library(readxl)
library(classInt)
library(RColorBrewer)
library(maptools) #to read shapefiles

2. Download the data files (note they are not ready for use but need some cleaning as there are more areas in the excel files than polygons in the shape file). 726 more words

R

Avoid messy lines while drawing worldmap in ggplot2

When I was plotting worldmap, I constantly encountered the same problem: the region polygons had messy lines running across the same region, which should not happen. 855 more words

R

India's Chloropleth Map in R

I got a request to explain how I plotted the chloropleth in my Shiny app. So here it goes!

library(ggplot2)
library(rgeos)
library(Cairo) 
library(ggmap) 
library(scales)
library(RColorBrewer)
library(gpclib)
library(sp)
library(maptools)
library(dplyr)

… 362 more words
Ggplot2

Demonetisation twitter analysis: sentimental plot

This post is continuation of my previous post: Demonetisation twitter analysis: Word Cloud.

Frequency of words

Following code look up the frequency of the terms “demonetisation” and “modi” in the terms. 393 more words

Ggplot2

Demonetisation twitter analysis: Word Cloud

I was curious about text mining and I started off doing sentimental analysis on Hillary Clinton’s and Donald Trump’s tweets during the US Presidential elections. Later, I did sentimental analysis after cyclone Vardah that hit Chennai. 756 more words

Ggplot2

IMDb user ratings: # of film ratings

INTRO

A few months ago, I discovered that IMDb users can download data about the films they have rated.

I’m a great lover of all things film related, but someone who’s even more of a film geek than me is my other half who’s had an IMDb account set up for several years now. 354 more words

Coding

Ordering Categories within ggplot2 Facets

I saw Simon Jackson’s recent blog post regarding ordering categories within facets. He proposed a way of dealing with the problem of ordering variables shared across facets within facets. 595 more words

R