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

Feature Request - Implement vctrs methods to support tidyr #155

Open
nir4most opened this issue May 12, 2021 · 0 comments · May be fixed by #180
Open

Feature Request - Implement vctrs methods to support tidyr #155

nir4most opened this issue May 12, 2021 · 0 comments · May be fixed by #180

Comments

@nir4most
Copy link

Example to show issue encountered when attempting to pivot a formatted data.frame.

Reprex:

library(formattable)
library(tidyr)

(exampledf_unformatted <- data.frame(
  index = letters[1:5],
  curr1 = 1:5,
  curr2 = 6:10
))

pivot_longer(exampledf_unformatted,cols=-1)


(exampledf_formatted <- data.frame(
  index = letters[1:5],
  curr1 = currency(1:5),
  curr2 = currency(6:10)
))

pivot_longer(exampledf_formatted,cols=-1)

Error:

Error: Can't combine `curr1` <formattable> and `curr2` <formattable>.
x Some attributes are incompatible.
i The author of the class should implement vctrs methods.
i See <https://vctrs.r-lib.org/reference/faq-error-incompatible-attributes.html>.

Session Info:

> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

other attached packages:
[1] tidyr_1.1.3         formattable_0.2.0.1
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

Successfully merging a pull request may close this issue.

1 participant