1
我有一个数据框,其中包含两种类型的列和带有名称的向量。 如何选择数据框中的某些行与矢量字符串匹配。匹配数据框中的字符串向量中的模式
name = c("[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]")
expression = c(118.84, 90.04, 106.6, 104.99, 93.2, 66.84, 90.02, 108.03, 111.83)
dataset <- as.data.frame(cbind(name, expression))
nam <- c("HPS5", "HPS6", "HPS9", "HPS2")
函数应该返回日期仅框架规定的线路 我尝试 dataset[mapply(grepl,nam,dataset$name)]
但它没有工作