Week Three: Refining with Inkscape

I have to say, I found working with R to be more fun than Inkscape. Despite handmaking Mother’s Day cards every year since I was a wee lass, my graphic design eye is not that sharp. One of my most startling (and later annoying) discoveries while working through these exercises was that my apartment is horribly lit – I dragged nearly every lamp in the house to my desk before finding one that could sufficiently light the examples in the book so they’d look something like what I what I could match the colors to on the screen.

After having trouble locating the correct fonts in Inkscape to match those used in the book, I’ve decided to dismount my Inkscape Open-Source high horse and embrace the use of Adobe Illustrator, at least for the last finishing touches. I have not received grades for the below yet, but know that there is a lot of room for improvement.

Figure 1

1

Figure 2

2

Figure 3

3

Figure 4

[Note to self: Track down and insert]

Figure 5

5

Figure 6

6

Document Generation with R in RStudio

This blogpost was created in RStudio using the rmarkdown package. For practice, I wanted to reproduce the plots created during week two and display them along with respective code.

Unfortunately, I only made it half-way, as only the code shows up, not the graphics. I was was hoping it would turn out something  sort of like so: http://rpubs.com/audiblediner/74483. Well, it’s a start.

 

Figure 1

hotdogs <-read.csv("http://datasets.flowingdata.com/hot-dog-contest-winners.csv", sep=",", header=TRUE)
fill_colors <- c()
for ( i in 1:length(hotdogs$New.record) ) {
if (hotdogs$New.record[i] == 1) {
fill_colors <- c(fill_colors, "#821122")
} else {
fill_colors <- c(fill_colors, "#cccccc")
}
}
barplot(hotdogs$Dogs.eaten, names.arg=hotdogs$Year, col=fill_colors, border=NA, space=0.3, xlab="Year", ylab="Hot dogs and buns (HDB) eaten", main="Nathan's Hot Dog Eating Contest Results, 1980-2010")

 

Figure 2

hot_dog_places <- read.csv('http://datasets.flowingdata.com/hot-dog-places.csv', sep=",", header=TRUE)
names(hot_dog_places) <- c("2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "2010")
hot_dog_matrix <- as.matrix(hot_dog_places)
barplot(hot_dog_matrix, border=NA, space=0.25, ylim=c(0, 200), xlab="Year", ylab="Hot dogs and buns (HDB) eaten", main="Hot Dog Eating Contest Results, 2000-2010")

 

Figure 3

subscribers <-
read.csv("http://datasets.flowingdata.com/flowingdata_subscribers.csv", sep=",", header=TRUE)
plot(subscribers$Subscribers, type="h", ylim=c(0, 30000), xlab="Day", ylab="Subscribers")
points(subscribers$Subscribers, pch=19, col="black")

 

Figure 4

population <-
read.csv("http://datasets.flowingdata.com/world-population.csv", sep=",", header=TRUE)
plot(population$Year, population$Population, type="l", bty="n", ylim=c(0, 7000000000), xlab="Year", ylab="Population")

 

Figure 5

postage <- read.csv("http://datasets.flowingdata.com/us-postage.csv", sep=",", header=TRUE)
plot(postage$Year, postage$Price, type="s", main="US Postage Rates for Letters, First Ounce, 1991-2010", xlab="Year", ylab="Postage Rate (Dollars)")

 

Figure 6

unemployment <- read.csv("http://datasets.flowingdata.com/unemployment-rate-1948-2010.csv", sep=",")
scatter.smooth(x=1:length(unemployment$Value), y=unemployment$Value, ylim=c(0,11), degree=2, col="#CCCCCC", span=0.5)

 


Data and Exercise Sources:  Yau, N. (2011). Visualize this: The FlowingData guide to design, visualization, and statistics. Indianapolis, Ind: Wiley Pub.

Playing with Plot.ly

I made the below using plotly, an online visualization and analytics tool. This is the first time making a visualization using plotly, so my goal was more to futz around  and figure out how it works than to really set myself up to do some analysis. Don’t judge too harshly! Maybe I’ll come back in a couple months so that my future data visualizing self can rip into my former self.

 

Week Two : Creating Visualizations using R and R-Studio

The below may not look like much, but for me creating them felt kind of magical.

Source for exercises: Yau, N. (2011). Chapter 4: Visualizing Patterns over Time. In Visualize this: The FlowingData guide to design, visualization, and statistics (pp. 92-133). Indianapolis, Ind.: Wiley Pub.

Figure 1

1

Figure 2

2

Figure 3

3

Figure 4

5

Figure 5

4

Figure 6

6

Next Week: Refining these with Inkscape