我有一個數據幀作爲這樣更新一個數據幀的一個子集
col.1 <- c("a", "b", "c", "d", "e", "b", "c")
col.2 <- c(22, 33, 55, 66, 66, 22, 54)
df <- data.frame(col.1, col.2)
和我想更新col.2
至100當df$col.1
匹配search.df
search.df <- c("b", "d")
事實上,我有dataframe
1k +行,我的search.df
有16個元素。我知道有些SQL和R.我無法找到一個簡單的更新