You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm creating a Shiny app where users can filter their data and I display it in your lineup table (Thanks for making it!). Unfortunately, if the user wants to filter one of the factor variables to single level, that column and any column to the right in the table does not show up. Below I have an example where new_var is a factor with a single level and thus, the entire table doesn't show up. I think this is a bug since I didn't find anything in the help files about this.
library(shiny)
library(lineupjs)
library(dplyr)
ui <- fluidPage(
fluidRow(
lineupOutput("lineup1")
)
)
server <- function(input, output) {
output$lineup1 <- renderLineup({
temp1 = iris %>% mutate(new_var = "test") # works because it's a character
temp2 = iris %>% mutate(new_var = as.factor("test")) # does not work
temp3 = iris %>% filter(Species == 'virginica') # works - don't know why it does but temp2 doesn't
lineup(temp2, width = "100%")
})
}
# Run the application
shinyApp(ui = ui, server = server)
The text was updated successfully, but these errors were encountered:
thx for reporting. R Shiny automatically transforms arrays with just one element into a primitive value. In your case the array ["test"] was converted to "test" which is not a valid list of categories. I added a fix that is now part of the master branch
I'm creating a Shiny app where users can filter their data and I display it in your lineup table (Thanks for making it!). Unfortunately, if the user wants to filter one of the factor variables to single level, that column and any column to the right in the table does not show up. Below I have an example where new_var is a factor with a single level and thus, the entire table doesn't show up. I think this is a bug since I didn't find anything in the help files about this.
The text was updated successfully, but these errors were encountered: