📅  最后修改于: 2022-03-11 14:52:00.551000             🧑  作者: Mango
# 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"))