1
,收到以下錯誤,當我請從unnest
文檔的例子:tidyr UNNEST R錯誤在captureDots():該參數已經被評估
Error in captureDots() : the argument has already been evaluated
。
我也在這裏得到錯誤的例子:https://blog.rstudio.org/2016/02/02/tidyr-0-4-0/。
> version
_
platform x86_64-apple-darwin13.4.0
arch x86_64
os darwin13.4.0
system x86_64, darwin13.4.0
status
major 3
minor 3.2
year 2016
month 10
day 31
svn rev 71607
language R
version.string R version 3.3.2 (2016-10-31)
nickname Sincere Pumpkin Patch
> library(tidyr)
> library(dplyr)
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
> df <- data_frame(
+ x = 1:3,
+ y = c("a", "d,e,f", "g,h")
+)
> df %>%
+ transform(y = strsplit(y, ",")) %>%
+ unnest(y)
x y
1 1 a
2 2 d
3 2 e
4 2 f
5 3 g
6 3 h
>
> # Or just
> df %>%
+ unnest(y = strsplit(y, ","))
# A tibble: 6 × 2
x y
<int> <chr>
1 1 a
2 2 d
3 2 e
4 2 f
5 3 g
6 3 h
>
> # It also works if you have a column that contains other data frames!
> df <- data_frame(
+ x = 1:2,
+ y = list(
+ data_frame(z = 1),
+ data_frame(z = 3:4)
+ )
+)
> df %>% unnest(y)
Error in captureDots() : the argument has already been evaluated
它'tidyr_0.6.1'沒有錯誤的工作原理 – akrun
奇怪,剛剛升級,我仍然得到錯誤。用最新的'tidyverse'獲取錯誤。 – ericgtaylor
順便說一句我正在使用R 3.3.3 – akrun