计算列表中的元素重复到数据框中的次数

时间:2018-09-30 18:35:15

标签: r

我需要计算单个途径重复进入数据帧的次数,例如:hsa04014 = 5,hsa04012 = 20等。有人可以帮助我吗?

我的数据结构是:

structure(list(Hugo_Symbol = c("ABL1", "ACACA", "ACOX1", "ACTA2", 
"ACTB", "ACVR1"), Entrez_Gene_Id = c(25L, 31L, 51L, 59L, 60L, 
90L), Pathways = c("hsa04014,hsa04012,hsa04110,hsa04722,hsa05200", 
"hsa04910,hsa04922", "hsa04024,hsa04520", "hsa04270", "hsa04014,hsa04390,hsa04510,hsa04520,hsa04530,hsa04921,hsa04919,hsa05200", 
"hsa04350")), row.names = c(NA, -6L), class = c("grouped_df", 
"tbl_df", "tbl", "data.frame"), vars = "Hugo_Symbol", drop = TRUE, indices = list(
    0L, 1L, 2L, 3L, 4L, 5L), group_sizes = c(1L, 1L, 1L, 1L, 
1L, 1L), biggest_group_size = 1L, labels = structure(list(Hugo_Symbol = c("ABL1", 
"ACACA", "ACOX1", "ACTA2", "ACTB", "ACVR1")), row.names = c(NA, 
-6L), class = "data.frame", vars = "Hugo_Symbol", drop = TRUE))

0 个答案:

没有答案