geom_smooth当y公式中的变量被转换时,有没有办法使用?例如:
#This works:
myplot <- qplot(speed, dist, data=cars)
(myplot + geom_smooth(method="lm", formula=y~log(x)))
#does not work
(myplot + geom_smooth(method="lm", formula=log(y)~x))
Run Code Online (Sandbox Code Playgroud)
我所追求的是这样一条线:
myplot + geom_line(aes(x=speed, y=exp(predict(lm(log(dist)~speed)))))
Run Code Online (Sandbox Code Playgroud)