Reputation: 311
I receive the following error when I run the examples from the unnest
documentation:
Error in captureDots() : the argument has already been evaluated
.
I also get the error on the examples here: 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
Upvotes: 1
Views: 350
Reputation: 311
installed latest versions dplyr
, tidyr
, and tidyverse
and works now with R 3.2.2.
Upvotes: 1