Here is one way of visualizing the data you have presented. However, I have used some liberties and assumptions to create this plot.
First, create a year_quarter variable that simply concatenates the year and quarter to present the time on the X axis. The following piece of code can do this in R
year_quarter = paste(dat$year, dat$Quarter, sep="-")
Now, the dataset you have will look like:
> dat
Variable value year Quarter Location year_quarter
1 A 48.235 2011 Q1 North 2011-Q1
2 B 65.444 2011 Q2 North 2011-Q2
3 C 77.453 2011 Q3 North 2011-Q3
4 D 44.678 2011 Q4 North 2011-Q4
5 A 88.542 2012 Q1 South 2012-Q1
6 B 66.566 2012 Q2 South 2012-Q2
7 C 55.443 2012 Q3 South 2012-Q3
8 D 78.990 2012 Q4 South 2012-Q4
Finally, using ggplto2
, you can create the plot such that the colour represents the value, the shape represents the Location and the size represents the Variable.
This simple one liner can help you produce such a plot:
p = ggplot(dat, aes(x = year_quarter, y = value, colour = value)) + geom_point(aes(shape = Location,size = Variable))
This is how the output plot looks like:
Note that you can also add geom_line
with interaction
if you would like the lines to be connected based on Location and Variable.