R語言學習-table()結果提取

test <- c(1,2,3,2,1,1,5,6,4,5,1) test [1] 1 2 3 2 1 1 5 6 4 5 1 test1 <- table(test) test1 test 1 2 3 4 5 6 #test中的元素 4 2 1 1 2 1 #各個元素出現的頻率 #1.提取table()中的元素 names(test1) [1] "1" "2" "3" "4" "5"
相關文章
相關標籤/搜索