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)]
但它沒有工作