[r] Persistent invalid graphics state error when using ggplot2