@nathaneastwood it was faster than I thought to implement this. I basically copied the code from datawizard functions, changed the select helpers and removed other datawizard functions. Not all arguments are implemented but I think it's a good start. Below are some examples to check that poorman and tidyr outputs match (these are also implemented in tests).
Things to note:
one important difference with tidyr::pivot_wider is about the NSE. For example, the following works with tidyr but not with poorman:
To make it work with poorman, we need to use quoted names. Maybe I simply missed something about how you deal with NSE in your package.
I added tidyr in Suggests and loaded it in the tests for pivot_ functions but it has some side effects on other tests because of namespace collisions. I think it is useful to test that the outputs of tidyr and poorman match so I'd like to keep these but I don't know how to deal with these side effects (never used tinytest before). What do you think?
I'm not very familiar with your coding style so let me know if I should improve the syntax in some places (or you can just modify this PR directly).
Once everything is addressed, I can add some bullet points in NEWS and bump the package version (if necessary).
@nathaneastwood it was faster than I thought to implement this. I basically copied the code from
datawizard
functions, changed the select helpers and removed otherdatawizard
functions. Not all arguments are implemented but I think it's a good start. Below are some examples to check thatpoorman
andtidyr
outputs match (these are also implemented in tests).Things to note:
one important difference with
tidyr::pivot_wider
is about the NSE. For example, the following works withtidyr
but not withpoorman
:To make it work with
poorman
, we need to use quoted names. Maybe I simply missed something about how you deal with NSE in your package.I added
tidyr
in Suggests and loaded it in the tests for pivot_ functions but it has some side effects on other tests because of namespace collisions. I think it is useful to test that the outputs of tidyr and poorman match so I'd like to keep these but I don't know how to deal with these side effects (never used tinytest before). What do you think?I'm not very familiar with your coding style so let me know if I should improve the syntax in some places (or you can just modify this PR directly).
Once everything is addressed, I can add some bullet points in NEWS and bump the package version (if necessary).
Close #47, close #48.
Examples for
pivot_longer
Created on 2022-07-28 by the reprex package (v2.0.1)
Examples for
pivot_wider()
Created on 2022-07-28 by the reprex package (v2.0.1)