ggplot2 also has the possibility to pass in arguments to the function. Not sure if you want to support this:

http://docs.ggplot2.org/current/stat_function.html