tidyr unnest r captureDots() 中的错误:参数已被评估
tidyr unnest r Error in captureDots() : the argument has already been evaluated
当我 运行 来自 unnest
文档的示例时,我收到以下错误:
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
安装了最新版本 dplyr
、tidyr
和 tidyverse
,现在可以使用 R 3.2.2。
当我 运行 来自 unnest
文档的示例时,我收到以下错误:
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
安装了最新版本 dplyr
、tidyr
和 tidyverse
,现在可以使用 R 3.2.2。