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

icon_assign doesn't work if the column contains a value that is NA #62

Open
DrNicolaDennis opened this issue Nov 2, 2023 · 0 comments

Comments

@DrNicolaDennis
Copy link

See code below, if the column contains an NA value then all the labels in the column read NA

`
remotes::install_github("kcuilla/reactablefmtr", force = TRUE)
library(reactablefmtr)

#This works
areas <- data.frame(name = c("One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"))
areas$responseCount <- 1:9

reactable(
areas,
columns = list(
responseCount = colDef(name = "Responses",
cell = icon_assign(areas,
show_values = "left")
)
)
)

#but if we add a row that contains NA, then all the labels read NA
areas <- data.frame(name = c("One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Not applicable"))
areas$responseCount <- c(1:9,NA)

reactable(
areas,
columns = list(
responseCount = colDef(name = "Responses",
cell = icon_assign(areas,
show_values = "left")
)
)
)
`

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

No branches or pull requests

1 participant