我試圖做一個NLS適合與下列數據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)
配件與GGPLOT2一個NLS - 類型的錯誤對象「符號」是不是subsettable
我到目前爲止的代碼(有點簡單化)是
ggplot(df, aes(x = t, y = m)) +
geom_point() +
geom_smooth(method = "nls", formula=log(y)~x)
但我得到以下錯誤
Error in cll[[1L]] : object of type 'symbol' is not subsettable
我瀏覽過計算器,發現類似的問題,但我一直沒能解決問題。我真的很想繪製數據而不改變軸。
任何幫助,非常感謝。