Dplyr's mutate函數可以評估「鏈接」表達式,例如, library(dplyr)
data.frame(a = 1) %>%
mutate(b = a + 1, c = b * 2)
## a b c
## 1 1 2 4
這怎麼實現?在dplyr的源代碼快速瀏覽發現候補碼的基本結構: library(lazyeval)
library(rlang)
com
我正在嘗試執行一些參數化的dplyr操作。最簡單的可重複的例子來表達問題的根源是這樣的: # Data
test <- data.frame(group = rep(1:5, each = 2),
value = as.integer(c(NA, NA, 2, 3, 3, 5, 7, 8, 9, 0)))
> test
group value
1 1 NA
我收到的時候我加載一些庫中的R以下錯誤: library(forecast) Error : object ‘f_eval’ is not exported by 'namespace:lazyeval' In addition: Warning message: package ‘forecast’ was built under R version 3.3.2 Error: package o