#' Timestamp
#'
#' As a character vector in ISO-8601 format.
#'
#' @noRd
Timestamp <- function() {
format(Sys.time(), "%FT%T")
}
#' Create random strings
#'
#' @param len string length.
#' @noRd
random_string <- function(len = 16) {
values <- c(letters, LETTERS, 0:9)
paste(sample(values, len, replace = TRUE), collapse = "")
}
#' Wraps message condition of R
#'
#' @param ... arguments to be passed to \code{paste} call.
#' @noRd
event_message <- function(...) {
.event_condition(message, ...)
}
event_stop <- function(...) {
# TODO match call for stop
.event_condition(stop, ...)
}
.event_condition <- function(cond, ...) {
dots <- list(...)
## make cond from NSE to character for parsing..
cond <- as.character(substitute(cond))
if (getOption("SHINYNOTES.VERBOSE")) {
text <- paste("[shinyNotes]", dots)
eval(parse(text = sprintf("%s(\"%s\")", cond, text, call)))
} else {
invisible()
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.