📌  相关文章
📜  根据行索引添加列值 - R 编程语言代码示例

📅  最后修改于: 2022-03-11 14:52:00.551000             🧑  作者: Mango

代码示例1
# We can use row_number() function in dplyr 
# We will test if the row is present in your vector and assign the value accordingly

library(dplyr)
sig = c(5, 10, 20)

genes %>%
mutate(Sig = ifelse(row_number() %in% sig, "YES", "NO"))