simplifyDF <-
function(d, stringsAsFactors=FALSE) {
convert_numeric_to_int <- function(x) {
ret <- if(is.numeric(x)) {
if(all(x == as.integer(x))) {
as.integer(x)
} else {
x
}
} else {
x
}
ret
}
as.data.frame(lapply(d, convert_numeric_to_int), stringsAsFactors=stringsAsFactors)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.