我正在尝试使用以下数据与ggplot配合:
df <- data.frame(t = 0:30, m = c(125.000000, 100.248858, 70.000000, 83.470795, 100.000000, 65.907870, 66.533715, 53.588087, 61.332351, 43.927435, 40.295448, 44.713459, 32.533143, 36.640336, 40.154711, 23.080295, 39.867928, 22.849786, 35.014645, 17.977267, 21.159180, 27.998273, 21.885735, 14.273962, 13.665969, 11.816435, 25.189016, 8.195644, 17.191337, 24.283354, 17.722776)
我到目前为止的代码(有点简化)是
ggplot(df, aes(x = t, y = m)) +
geom_point() +
geom_smooth(method = "nls", formula=log(y)~x)
Run Code Online (Sandbox Code Playgroud)
但是我收到以下错误
Error in cll[[1L]] : object of type 'symbol' is not subsettable
Run Code Online (Sandbox Code Playgroud)
我浏览了stackoverflow并发现了类似的问题,但我无法解决问题.我真的想在不改变轴的情况下绘制数据.
任何帮助深表感谢.