I am trying following code to get non-linear regression without specifying any particular function:
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)
But it gives me following warning:
Warning message:
Computation failed in `stat_smooth()`:
object of type 'symbol' is not subsettable
The plot is shown only with points. No regression line is plotted.
How can I correct this problem?
