I am new to R Shinyapps, hence, my question may sound a bit stupid.
Please accept my apologies for this.
I am struggling to get the data into a table according to the required column format.
Currently, the table looks like below:
So I have 11 columns in the table, I want the columns to formatted as below:
- "Col-2 to Col-7" all having a 1 digit decimal place.
- "Col-8 to Col-10" all having 0 digit decimal place (no decimal).
- "Col-11" having 2 digit decimal place.
Any suggestions on how to do this?
I have used the below "renderTable" function to generate the table:
output$table <- renderTable(align="c", digits = 1, width="auto", na="-", subset(all, PRODUCT_NAME==as.character(input$product_choice))
[,c("Col-1", "Col-2", "Col-3", "Col-4", "Col-5", "Col-6", "Col-7", "Col-8",
paste0("Col-9 ",input$cur), paste0("Col-10 ",input$cur), "Col-11")],)
I have tried using the "Digits = 1" but it formats all the columns to 1 decimal place.
I am unable to find a way to apply the digits argument for different decimal places in separate columns. But, I need to format the columns separately I need the experts here to help me with this, please. I shall be highly thankful to you.