commit 42f5cae30328db8ce6a68e904140a69a565cd6dc
parent af126e58a31d69cb77b3c9bfdf2f439cdfc04c04
Author: eamoncaddigan <eamon.caddigan@gmail.com>
Date: Tue, 28 Jul 2015 13:50:13 -0400
Added comments.
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/ageAtAcquisition.R b/ageAtAcquisition.R
@@ -1,9 +1,14 @@
+# First stab at the MoMA data. I wondered if the museum would tend toward
+# collecting older works as time went on.
+
require(dplyr)
require(tidyr)
require(ggplot2)
+
artworks <- read.csv("Artworks.csv", stringsAsFactors = FALSE)
+# Just pull out the year, since dates aren't always formatted correctly.
artworks <- artworks %>%
filter(grepl("[0-9]{4}", DateAcquired),
grepl("[0-9]{4}", Date)) %>%
@@ -12,6 +17,7 @@ artworks <- artworks %>%
acquisition_age = year_acquired-year_started) %>%
filter(acquisition_age >= 0)
+# Plot each work's age vs. its year of acquisition
ggplot(artworks, aes(x=year_acquired, y=acquisition_age)) +
geom_point(alpha = 0.01, position = position_jitter(w = 0.5, h = 0.5)) +
geom_smooth(se=FALSE, size=1.5) +