R 语言中双中括号 [[]]与数据类型列表的关系
R 语言中双中括号 [[]]与数据类型列表的关系。
for (row in 1:nrow(gterms)) { gene_terms <- str_split(gterms[row,"GOs"], ",", simplify = FALSE)[[1]] gene_id <- gterms[row, "query_name"][[1]] tmp <- data_frame(gene = rep(gene_id, length(gene_terms)), term = gene_terms) gene2go <- rbind(gene2go, tmp)}
。