作者Udyr (Udyr)
看板R_Language
标题[问题] 不同字串重复次数
时间Thu Dec 24 01:20:30 2015
[问题类型]:
程式谘询(我想用R 做某件事情,但是我不知道要怎麽用R 写出来)
[软体熟悉度]:
新手(没写过程式,R 是我的第一次)
[问题叙述]:
有一些字串,如
>listA
[1] "001" "002" "003" "004" "005"
>listB
[1] "002" "004" "006"
>listC
[1] "001" "003" "005"
欲得到每个element重复出现的次数
element freq
001 2
002 2
003 2
004 2
005 2
006 1
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 223.140.183.15
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/R_Language/M.1450891233.A.E1F.html
1F:→ celestialgod: table(do.call(c, list(listA,listB,listC))) 12/24 01:21
2F:→ celestialgod: table(c(listA,listB,listC))就好了(摊手 12/24 01:42