2
的geom_smooth不工作我想下面的代碼獲取非線性迴歸不指定任何特定功能:NLS方法ggplot
library(drc)
head(heartrate)
# pressure rate
#1 50.85 348.76
#2 54.92 344.45
#3 59.23 343.05
#4 61.91 332.92
#5 65.22 315.31
#6 67.79 313.50
library(ggplot2)
ggplot(heartrate, aes(pressure, rate)) +
geom_point() +
geom_smooth(method="nls", formula = rate ~ pressure)
但它給了我以下警告:
Warning message:
Computation failed in `stat_smooth()`:
object of type 'symbol' is not subsettable
的情節僅以點顯示。沒有繪製迴歸線。
我該如何解決這個問題?