INWTlab / shinyMatrix

https://inwtlab.github.io/shinyMatrix/
Other
19 stars 6 forks source link

More of a question than issue: how to hide row header column in shinyMatrix? #22

Closed lgirola closed 3 years ago

lgirola commented 3 years ago

Hi! When generating an input matrix, is it possible to hide or eliminate the left-most column for row headers? If not possible, are there other ways to adjust it (obfuscate it) by other means such as narrowing, filling in with color, etc.?

Below is simple R code that generates the matrix pictured at the bottom:

library(shiny)
library(shinyMatrix)

m <- matrix(runif(12), 6, 2, dimnames = list(NULL, c("x", "y"))) 
ui <- fluidPage(   
  titlePanel("shinyMatrix: Simple App"),   
  sidebarPanel(     
    width = 6,     
    tags$h4("Input matrix"),     
    matrixInput("sample",value = m,rows = list(extend = TRUE),cols = list(names = TRUE))
    ),   
  mainPanel(     
    width = 6,plotOutput("scatter")) 
  ) 

server <- function(input, output, session) {   
  output$scatter <- renderPlot({     
    plot(input$sample, col = "red", main = "Scatterplot")}) 
  } 

shinyApp(ui, server)

And now the output image:

shinyMatrix

aneudecker commented 3 years ago

@lgirola Settings rows = list(extend = TRUE, names = FALSE) should do the trick

lgirola commented 3 years ago

Perfect! Works and looks great, I rely heavily on your package. I love matrices. Thank you for this!