Skip to content

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

Description

@DrNicolaDennis

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")
)
)
)
`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions