I am making a visualization that involves factors, ratios, and countries. There are about 15 factors and I am trying to use small multiples to create a large graph where the X and Y axes are the factors, ie, roughly:
Population
Num of Cars
Num of houses
Num of Houses Num of Cars Population
Where each intersection would be a plot of the values for each country (so, the plot at the intersection of # of Cars and # of Houses would be # of houses vs # of cars, etc). I currently have a data frame with the information with column headers: country, factors, ratios. I've tried using a few methods (facet_grid
, facet_wrap
, etc), but just can't get an output - when I run the script, a blank screen pops up. I haven't been able to figure out how to successfully google the type of small multiples plot i'm trying to create and am having a bit of trouble. I'm also brand new to R and have been stuck for a great many hours.
Any advice?
Edited: More information
some sample data:
factor country year ratio
1 LiteracyRate Afghanistan 2000 0.3622047
2 PostSecondarySchoolAgePopulation Afghanistan 2011 0.9272919
3 PrePrimaryEducationSchoolAgePopulation Afghanistan 2012 0.9397506
4 PrimaryEducationSchoolAgePopulation Afghanistan 2009 0.9344603
5 SecondarySchoolAgePopulation Afghanistan 2008 0.9301103
(I have this data for every country, and more factors than shown, also)
code that has been most successful so far:
try <- read.table(".../temper.csv", header = TRUE, sep = ",")
remr <- ggplot(try, aes(factor, ratio)) + geom_point()
remr + facet_grid(factor ~ factor)
Graph produced: http://www.flickr.com/photos/94273266@N05/11411186776/