I am using the renderTable function from the R Shiny package and it is returning a table with row names. Ideally I want a table to be displayed with only two columns, one for 'Month' and one for 'Value'. The output I currently get includes the row names. I have tried a few things to exclude row names but was unsuccessful. Any thoughts?
output$valueTable <- renderTable({
if(input$table_view == TRUE){
data.frame(Month = Month(), Value = valueData()[,"Value"])
}
})
To remove the row names or column names from a matrix, we just need to set them to NULL, in this way all the names will be nullified.
Row names are currently allowed to be integer or character, but for backwards compatibility (with R <= 2.4. 0) row. names will always return a character vector. (Use attr(x, "row.
this instruction is working for me
output$summaryTable <- renderTable({
df()$donnees
},
include.rownames=FALSE)
Into your init code, put
options(xtable.include.rownames=F)
options(xtable.include.colnames=F)
this will disable it for all tables in your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With