autolayer function

Create a ggplot layer appropriate to a particular data type