→ celestialgod: 這樣c3會undefine吧 而且'0.xxx'是字串耶 04/06 22:47
→ celestialgod: '0.xxx'改成數字,c3改成 'c3' 04/06 22:48
→ celestialgod: 原PO要不要學一下怎麼用dplyr? 04/06 22:49
→ celestialgod: df = df %>% filter(c3 %in% (df %>% filter(c1 >= 04/06 22:50
→ celestialgod: 0.xxx , c2 == 1) %>% .$c3)) 04/06 22:50
感謝C大,不過剛剛嘗試, R回應說
Error: could not find function "%>%"
PS.抱歉 是自己環境沒安裝 dplyr
我再試試看
→ celestialgod: 板上搜尋dplyr可以找到相關教學文 04/06 22:51
ok~感謝提示,等等來研究一下dplyr的用法
→ joejoe14758: df <- df[ df[c1>=0.xxx] %in% df[c2==1] ] 04/06 23:52
感謝分享,不過R說error
※ 編輯: aee36900 (220.132.153.20), 04/07/2016 00:06:12
※ 編輯: aee36900 (220.132.153.20), 04/07/2016 00:10:42
→ joejoe14758: 痾 那是用你上面的條件來作的... 04/07 01:00
→ joejoe14758: df [ df[df$c2==56]%in%df[df$c1>5000] ] 04/07 01:01