Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

walk2 unclasses dates but other functions don't #524

Closed
gergness opened this issue Jul 10, 2018 · 1 comment
Closed

walk2 unclasses dates but other functions don't #524

gergness opened this issue Jul 10, 2018 · 1 comment

Comments

@gergness
Copy link
Contributor

gergness commented Jul 10, 2018

I find this behavior confusing - walk2 is the only function out of map, map2, walk and walk2 that loses the class on dates. I believe it is due to the transpose in pwalk (and so is related to #471), but because map2 doesn't have this behavior I thought there may be another way to solve this.

library(purrr)
dates <- seq(as.Date('2018-07-01'), as.Date('2018-07-02'), by = "day")

walk2(dates, dates, ~print(.x))
#> [1] 17713
#> [1] 17714

map(dates, ~.)
#> [[1]]
#> [1] "2018-07-01"
#> 
#> [[2]]
#> [1] "2018-07-02"
map2(dates, dates, ~.x)
#> [[1]]
#> [1] "2018-07-01"
#> 
#> [[2]]
#> [1] "2018-07-02"
walk(dates, ~print(.))
#> [1] "2018-07-01"
#> [1] "2018-07-02"

Created on 2018-07-10 by the reprex package (v0.2.0).

@lionel-
Copy link
Member

lionel- commented Nov 16, 2018

This was fixed in #554 thanks to @mikmart :)

@lionel- lionel- closed this as completed Nov 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants