值子集的數據幀我有這樣的數據幀:包含從陣列
'data.frame': 114034 obs. of 4 variables:
$ Ore : chr "01 00" "01 01" "01 02" "01 03" ...
$ SquareID: chr "10000" "10000" "10000" "10000" ...
$ Intens : num 0.0118 0.00987 0.00538 0.01318 0.00273 ...
$ Count : num 69 78 51 86 35 ...
我需要子集的全部數據幀。 SquareID等於那些數組值的數據幀的行。
Df<-subset.data.frame(Df,Df$SquareID==c(4702,4703,4704,4705,5434,5435,4706,4707,4708,4709,4820,4939,4821,4822,5551,5057,4823,5058,4824,4825,5059,4826,5174,4940,4941,5175,4942,4943,5177,5178,4944,5060,4945,5061,4946,5062,5063,4728,5295,5296,5297,5180,5181,4845,4846,4847,4963,4964,5199,4353,5082,4355,4356,4585,9536,4586,4587,4470,4588,4471,4589,4472,4473,5412,5413,5414,9653,4590,4591,5530,5315,5316,5318)
這樣,我得到了這樣的警告和錯誤的結果:
更長對象長度不短對象長度的倍數
請參閱%「'中的幫助文件'?」%。 – nrussell
我需要子集整個數據幀,我不需要一個向量作爲結果 – DanieleO
正確的,子集(Df,%c(...))中的SquareID%)。你的'SquareID'列是'character',但你應該先將它轉換爲'numeric'。 – nrussell