Consider the following:
df <- data.frame(a=1:10,b=2:11)
ggplot(df,aes(x=a,y=b)) + geom_point()+geom_text(aes(label=a,x=a+0.1))
This works.
However for some reason the following doesn't work:
plotGG <- function(data,shift) {
ggplot(data,aes(x=a,y=b)) + geom_point()+geom_text(aes(label=a,x=a+shift))
}
plotGG(df,.1)
Any clues??