Nothing
#' @useDynLib jsonlite C_escape_chars
deparse_vector_c <- function(x) {
.Call(C_escape_chars, x)
}
deparse_vector_r <- function(x) {
stopifnot(is.character(x))
if(!length(x)) return(x)
x <- gsub("\\", "\\\\", x, fixed=TRUE)
x <- gsub("\"", "\\\"", x, fixed=TRUE)
x <- gsub("\n", "\\n", x, fixed=TRUE)
x <- gsub("\r", "\\r", x, fixed=TRUE)
x <- gsub("\t", "\\t", x, fixed=TRUE)
x <- gsub("\b", "\\b", x, fixed=TRUE)
x <- gsub("\f", "\\f", x, fixed=TRUE)
paste0("\"", x, "\"")
}
# Which implementation to use
deparse_vector <- deparse_vector_c
#Below are older implementations of the same function
deparse_vector_old <- function(x) {
stopifnot(is.character(x))
x <- gsub("[\v\a]", "", x)
vapply(x, deparse, character(1), USE.NAMES=FALSE)
}
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.