[問題] 從large list中將各類別存成各表
[問題類型]:
程式諮詢(我想用R 做某件事情,但是我不知道要怎麼用R 寫出來)
[軟體熟悉度]:
新手(在coursera修完兩門的新手,問些蠢問題請包涵)
[問題敘述]:
想將ㄧ大表格,依照類別分割並另存各表。
依照各州再依照死亡率、出生率等排序,想分別存成'每州'的表格。主要目標是想抓各州
死亡率最低的醫院、出生率最高的醫院、出生率第五的醫院等
目前做法做到卡關,手機發文概略寫一下,排版亂請見諒
感謝幫助
[程式範例]:
X<-read.csv()
subx<-split(x,x$state)
這時會存成含54個元素但各元素row不同的large list,沒去na值
然後就不知道怎麼寫了,知道要迴圈,但不知道怎麼分割元素另存
For ( I in x$state){
list[i]<-lappy(subx[i],........
}
[環境敘述]:
Rsdutio3.1.2
[關鍵字]:
選擇性,也許未來有用
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.46.97.129
※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1427010184.A.E73.html
※ 編輯: popxpopxpop (114.46.97.129), 03/22/2015 15:44:35
→
03/22 17:37, , 1F
03/22 17:37, 1F
→
03/22 17:37, , 2F
03/22 17:37, 2F
→
03/22 17:37, , 3F
03/22 17:37, 3F
→
03/22 17:38, , 4F
03/22 17:38, 4F
→
03/22 18:01, , 5F
03/22 18:01, 5F
→
03/22 19:51, , 6F
03/22 19:51, 6F
→
03/22 19:51, , 7F
03/22 19:51, 7F
→
03/22 20:39, , 8F
03/22 20:39, 8F
→
03/22 20:39, , 9F
03/22 20:39, 9F
→
03/22 20:41, , 10F
03/22 20:41, 10F
→
03/22 20:41, , 11F
03/22 20:41, 11F
→
03/23 01:10, , 12F
03/23 01:10, 12F
→
03/23 01:11, , 13F
03/23 01:11, 13F
→
03/23 06:31, , 14F
03/23 06:31, 14F
→
03/23 06:31, , 15F
03/23 06:31, 15F
→
03/23 06:31, , 16F
03/23 06:31, 16F
→
03/23 06:31, , 17F
03/23 06:31, 17F
→
03/23 06:31, , 18F
03/23 06:31, 18F
→
03/23 07:06, , 19F
03/23 07:06, 19F
→
03/23 07:06, , 20F
03/23 07:06, 20F
→
03/23 07:07, , 21F
03/23 07:07, 21F
→
03/23 07:07, , 22F
03/23 07:07, 22F
→
03/23 10:47, , 23F
03/23 10:47, 23F
→
03/23 12:24, , 24F
03/23 12:24, 24F
R_Language 近期熱門文章
PTT數位生活區 即時熱門文章