Skip to content

as_loop() doesn't work correctly on pmap #10

@TimTeaFan

Description

@TimTeaFan
library(loopurrr)
#> Loading required package: purrr

x <- list(1, 1, 1)
y <- list(10, 20, 30)
z <- list(100, 200, 300)
a <- list(x, y, z)

# expected
pmap(a, sum)
#> [[1]]
#> [1] 111
#> 
#> [[2]]
#> [1] 221
#> 
#> [[3]]
#> [1] 331

# doesn't work
pmap(a, sum) %>% as_loop()
#> Error in !is_clipr: invalid argument type

# works!
pmap(list(x, y, z), sum) %>% as_loop()
#> Error in !is_clipr: invalid argument type

Created on 2022-10-05 by the reprex package (v0.3.0)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions