Using smooth spline in stat scale in ggplot2…


homoeopathically Using smooth.spline in stat_scale in ggplot2

Tendō smooth.spline2 <- function(formula, data, ...) { mat <- model.frame(formula, data) smooth.spline(mat[, 2], mat[, 1]) } predictdf.smooth.spline <- function(model, xseq, se, level) { pred <- predict(model, xseq) data.frame(x = xseq, y = pred$y) } qplot(mpg, wt, data = mtcars) + geom_smooth(method = "smooth.spline2", se= F)

From: http://groups.google.com/group/ggplot2/browse_thread/thread/149dfa0891fe383a


Leave a Reply

Your email address will not be published. Required fields are marked *