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

NA's in count when grouping in reactable #148

Closed
aavanesy opened this issue May 2, 2021 · 1 comment
Closed

NA's in count when grouping in reactable #148

aavanesy opened this issue May 2, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@aavanesy
Copy link

aavanesy commented May 2, 2021

Hello,

Please see a sample code

library(reactable)
data = data.frame(x = c('a','a','b','b'),
                  values = c(NA,5,3,NA))
reactable(data,
          groupBy = 'x')

image

Is it possible to count only the lines which aren't NA?

I want to see a(1), b(1) instead

Thank you

@glin
Copy link
Owner

glin commented May 15, 2021

Hi, this hasn't been possible before, but it is now in the development version of reactable:

  • colDef() gains a grouped argument to customize rendering for grouped cells in groupBy columns (#33, #94, #148).

If you install the development version of reactable, you can use a custom grouped cell renderer that filters NAs out of the row count. I wrote up a few examples of that here: #33 (comment)

@glin glin closed this as completed May 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants