2013 search results for "ggplot"

Visualizing Baltimore 3: Crime and Vacant Properties, Neighborhood Level

December 10, 2012
By
Visualizing Baltimore 3: Crime and Vacant Properties, Neighborhood Level

A few quick plots of West Baltimore neighborhoods, first Sandtown-Winchester: and Harlem Park: These aren’t very polished, I’ll put up better versions. Here’s the code for those that want it: ## gis libraries library(spBayes) library(MBA) library(geoR) library(fields) library(sp) library(maptools) library(rgdal)...

Read more »

Visualizing Baltimore 2: Vacant Property and Some More Crime

December 10, 2012
By
Visualizing Baltimore 2: Vacant Property and Some More Crime

One of the key predictors in my model for this crime project I’m working on is vacant houses and lots. I’ll speak to some findings about the relationship between levels of the different types of crime and vacant property in...

Read more »

"Economics-style" graphs with bezier() from Hmisc

December 10, 2012
By
"Economics-style" graphs with bezier() from Hmisc

So, I really think this one is pretty cool. We spend much of our time in R making graphs with data, but what if you have a theory that you’d like to express graphically? Something like what I’ll call “economics-style” graphs, i...

Read more »

Shiny apps are awesome

December 10, 2012
By
Shiny apps are awesome

RStudio has a new product called Shiny that, quoting from their website, "makes it super simple for R users like you to turn analyses into interactive web applications that anyone can use". See here for more information. A Shiny basically consists of two files: a ui.r file and a server.r file. The ui.r file, as it says, provides...

Read more »

Shiny apps are awesome

December 10, 2012
By
Shiny apps are awesome

RStudio has a new product called Shiny that, quoting from their website, "makes it super simple for R users like you to turn analyses into interactive web applications that anyone can use". See here for more information. A Shiny basically consists of two files: a ui.r file and a server.r file. The ui.r file, as it says, provides...

Read more »

Handling missing data with Amelia

December 9, 2012
By
Handling missing data with Amelia

So, what if you have data, but some of the observations are missing? Many statistical techniques assume no missingness, so we might want to “fill in” or rectangularize our data, by replacing missing observations with plausible substitutes....

Read more »

Fifty Shades of Grey in R

December 8, 2012
By
Fifty Shades of Grey in R

My wife went out to her book group tonight and their book of the month was 50 Shades of Grey. Sadly, I could think of is that plotting 50 shades in R would be a neat exercise. require(ggplot2) grey50 <- data.frame( x = rep(1:10, 5), y = rep(1:5, ...

Read more »

Mapping Primary Care Trust (PCT) Data, Part 1

December 7, 2012
By
Mapping Primary Care Trust (PCT) Data, Part 1

The launch or official opening or whatever it was of the Open Data Institute this week provided another chance to grab a snapshot of notable folk in the community, as for example demonstrated by people commonly followed by users of the #ODIlaunch hashtag on Twitter. The PR campaign also resulted in the appearance of some

Read more »

Speed up your map plotting in R

December 5, 2012
By
Speed up your map plotting in R

I have been forever annoyed at how long it takes to plot data on a large shapefile. And this is a domain where doesn’t matter if you’re working with MapInfo or R. Just zooming the figure takes ages. But a … Continue reading →

Read more »

Forbes Graph Makeover Contest Entry #1

December 5, 2012
By
Forbes Graph Makeover Contest Entry #1

Naomi Robbins is running a graph makeover challenge over at her Forbes blog and this is my entry for the B2B/B2C Traffic Sources one (click for larger version): And, here’s the R source for how to generate it: library(ggplot2)   df = read.csv("b2bb2c.csv")   ggplot(data=df,aes(x=Site,y=Percentage,fill=Site)) + geom_bar(stat="identity") + facet_grid(Venue ~ .) + coord_flip() + opts(legend.position

Read more »