1
爲什麼在將fft
(快速傅立葉變換)應用於數據幀時出現此錯誤?如果我自己對每個變量使用相同的函數,則沒有錯誤。如何正確地將fft函數應用於數據幀
df<-read.table(text="pregnant glucose blood skin INSULIN MASS DIAB AGE CLASS predict_probability
1 106 70 28 135 34.2 0.142 22 0 0.15316285
1 91 54 25 100 25.2 0.234 23 0 0.05613959
4 136 70 0 0 31.2 1.182 22 1 0.54034794
9 164 78 0 0 32.8 0.148 45 1 0.64361578
3 173 78 39 185 33.8 0.970 31 1 0.79185196
11 136 84 35 130 28.3 0.260 42 1 0.31927737
0 141 84 26 0 32.4 0.433 22 0 0.41609308
3 106 72 0 0 25.8 0.207 27 0 0.10460090
9 145 80 46 130 37.9 0.637 40 1 0.67061324
10 111 70 27 0 27.5 0.141 40 1 0.16152296
",header=T)
如果我寫fft(df$pregnant)
我得到所需要的結果,但我嘗試使用它的整個數據幀fft(df)
上我得到這個錯誤:
Error in fft(df) : non-numeric argument
當時的想法是,讓每列的詳細信息,然後添加新的信息作爲數據幀中的新列 – mql4beginner