2431 search results for "ggplot"

embeding a subplot in ggplot via subview

August 30, 2015
By
embeding a subplot in ggplot via subview

I implemented a function, subview, in ggtree that make it easy to embed a subplot in ggplot. An example is shown below: Read More: 131 Words Totally

Read more »

Coloring (and Drawing) Outside the Lines in ggplot

August 27, 2015
By
Coloring (and Drawing) Outside the Lines in ggplot

Time for another Twitter-inspired blog post this week, this time from a tweet by @JonKalodimos: Is there a way to do this in #rstats #ggplot2 https://t.co/kxWQFlYpbB— Jonathan Kalodimos (@JonKalodimos) August 27, 2015 I had seen and appreciated Ann’s post on her makeover of the main graphic in NPR’s story and did a quick mental check

Read more »

Spaghetti plots with ggplot2 and ggvis

August 19, 2015
By
Spaghetti plots with ggplot2 and ggvis

This post was motivated by this article that discusses the graphics and statistical analysis for a two treatment, two period, two sequence (2x2x2) crossover drug interaction study of a new drug versus the standard. I wanted to write about implementing those graphics and the statistical analysis in R. This post is devoted to the different

Read more »

Visualising thefts using heatmaps in ggplot2

August 17, 2015
By
Visualising thefts using heatmaps in ggplot2

This is a continuation of my previous article, where I gave a basic overview of how to construct heatmaps in R. Here, I will show you how to use R packages to build a heatmap on top of the map of Chicago to see which areas have the most amount of crime. We will require

Read more »

Making Static/Interactive Voronoi Map Layers In ggplot/leaflet

July 26, 2015
By
Making Static/Interactive Voronoi Map Layers In ggplot/leaflet

Despite having shown various ways to overcome D3 cartographic envy, there are always more examples that can cause the green monster to rear it’s ugly head. Take the Voronoi Arc Map example. For those in need of a primer, a Voronoi tesslation/diagram is: …a partitioning of a plane into regions based on distance to points

Read more »

A Path Towards Easier Map Projection Machinations with ggplot2

July 24, 2015
By
A Path Towards Easier Map Projection Machinations with ggplot2

The $DAYJOB doesn’t afford much opportunity to work with cartographic datasets, but I really like maps and tinker with shapefiles and geo-data when I can, plus answer a ton of geo-questions on StackOverflow. R makes it easy—one might even say too easy—to work with maps. All it takes to make a map of the continental

Read more »

This is one of my favorite ggplot2 plots I’ve ever made, but it…

July 21, 2015
By
This is one of my favorite ggplot2 plots I’ve ever made, but it…

This is one of my favorite ggplot2 plots I’ve ever made, but it makes me sad. Can you deduce what this plot conveys? Explain the sporadically dashed colored horizontal bands. Explain the red vertical bars. Explain the black vertical bars. If you answer all three correctly, and you can explain the rest of the plot, I’ll give you the code.

Read more »

Line plots of longitudinal summary data in R using ggplot2

July 9, 2015
By
Line plots of longitudinal summary data in R using ggplot2

I recently had an email for a colleague asking me to make a figure like this in ggplot2 or trellis in R: As I know more about how to do things in ggplot2, I chose to use that package (if it wasn't obvious from the plot or other posts). Starting Point Cookbook R/) has a

Read more »

Faceted “World Population by Income” Choropleths in ggplot

July 9, 2015
By
Faceted “World Population by Income” Choropleths in ggplot

Poynter did a nice interactive piece on world population by income (i.e. “How Many Live on How Much, and Where”). I’m always on the lookout for optimized shapefiles and clean data (I’m teaching a data science certificate program starting this Fall) and the speed of the site load and the easy availability of the data

Read more »

Shiny 0.12: Interactive Plots with ggplot2

June 16, 2015
By
Shiny 0.12: Interactive Plots with ggplot2

Shiny 0.12 has been released to CRAN! Compared to version 0.11.1, the major changes are: Interactive plots with base graphics and ggplot2 Switch from RJSONIO to jsonlite For a full list of changes and bugfixes in this version, see the NEWS file. To install the new version of Shiny, run: install.packages(c("shiny", "htmlwidgets")) htmlwidgets is not

Read more »