Nothing
#' Check Whether a Scalar is Convertible to Numeric
#'
#' @param x A \code{\link{data.frame}}.
#' @return A \code{\link{data.frame}}.
#' @export
#' @family logical helpers
#' @family data.frame helpers
#' @examples
#' df <- data.frame(a = 1:24,
#' b = as.character(1:24),
#' c = paste(" ", 1:24, " "),
#' d = LETTERS[1:24]
#' )
#' df[2, 2] <- df[3, 3] <- ""
#' df[3, 2] <- df[4, 3] <- " "
#' columns2numeric(df)
columns2numeric <- function(x) {
conv <- function(x) {
if (all(sapply(x, is.numeric))) {
res <- as.numeric(x)
} else {
res <- x
}
return(res)
}
res <- as.data.frame(lapply(x, conv))
return(res)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.