0
因此,我試圖將彙總命令應用於一堆矢量,並且在每個輸出中都有一個標有它所屬的郵政編碼的標籤。我也有一個這是可能的嗎?另外,我覺得有一種方法可以結合前兩步,但我不知道如何。非常感謝你的幫助!!!!這是我到目前爲止:如何組合子集並將總結應用於多個向量?
data.06511 <- subset(x, ZipCode == 6511)
data.06513 <- subset(x, ZipCode == 6513)
data.06515 <- subset(x, ZipCode == 6515)
data.06516 <- subset(x, ZipCode == 6516)
data.06519 <- subset(x, ZipCode == 6519)
lackfood.06511 <- data.06511$lackFood12Months_Bin
lackfood.06513 <- data.06513$lackFood12Months_Bin
lackfood.06515 <- data.06515$lackFood12Months_Bin
lackfood.06516 <- data.06516$lackFood12Months_Bin
lackfood.06519 <- data.06519$lackFood12Months_Bin
lackfood.pop <- x$lackFood12Months_Bin
請提供您的數據樣本和您的預期輸出,以便更容易地看到您正在嘗試做什麼。請參閱[這裏](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example?rq=1)瞭解如何創建一個很好的重現示例 – Craig