Converts designated columns of a dataframe to character. Defaults to
a dataframe where the first three columns can be coerced to character.
character vector with the columns to be converted to
character class. Defaults to
NOTE: Function was created to deal with a display bug in xtables (used by Shiny) The bug causes Date columns to be displayed improperly Shiny also displays all Numbers (including integers) with 2 decimal places Comment by R. Mark Sharp - this is just one way to modify the number of digits displayed. library(DT)
set.seed(323) data.frame(x=runif(10), y=rnorm(10), z=rpois(10, 1)) datatable() formatRound(columns=c('x', 'y'), digits=3)
A dataframe with the specified columns converted to class "character" for display with xtables (in shiny)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.