Closed byronvickers closed 6 months ago
Duplicate of #834
Ah, apologies! I missed that one somehow.
Sounds like this is known and there's no intention to modify the behaviour of partial
, so I'll go ahead just write a wrapper as suggested by Hadley in the linked issue.
Thanks to you and all the tidyverse folks for the hard work; it really improves the experience of working with R.
Using
partial
to set arguments toglue
seems to leave the resultant partially-applied function unable to access apparently-available variables.I'm not the first person to run into this issue (aside from it surely being a common enough use-case, there's a stack overflow question on the same topic here). However, I couldn't find any github issue raised for it so I thought it'd be worth raising the visibility in case it's unknown and/or unintended behaviour.
Raising as an issue on
partial
rather thanglue
as the unexpected behaviour seems to be due to howpartial
sets the environment of the resultant function rather than anything unexpected inglue
's behaviour.Created on 2024-03-08 with reprex v2.0.2