updated code for ggplot2, knitr and rgeos