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

When ext is a vector, path() recycles only the first value #430

Open
UchidaMizuki opened this issue Sep 1, 2023 · 0 comments · May be fixed by #446
Open

When ext is a vector, path() recycles only the first value #430

UchidaMizuki opened this issue Sep 1, 2023 · 0 comments · May be fixed by #446
Labels
bug an unexpected problem or unintended behavior

Comments

@UchidaMizuki
Copy link

path() of ... can be given a vector, but when ext is given a vector, only the first value is recycled.
I think some fix is needed, since users are likely to expect the result of purrr::map2_vec() shown in reprex.

library(fs)

path(LETTERS, ext = letters)
#> A.a B.a C.a D.a E.a F.a G.a H.a I.a J.a K.a L.a M.a N.a O.a P.a Q.a R.a S.a T.a 
#> U.a V.a W.a X.a Y.a Z.a

purrr::map2_vec(LETTERS, letters,
                \(LETTER, letter) path(LETTER, ext = letter))
#> A.a B.b C.c D.d E.e F.f G.g H.h I.i J.j K.k L.l M.m N.n O.o P.p Q.q R.r S.s T.t 
#> U.u V.v W.w X.x Y.y Z.z

Created on 2023-09-01 with reprex v2.0.2

@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Nov 1, 2023
@UchidaMizuki UchidaMizuki linked a pull request Feb 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants