#' valueBoxValues
#'
#' @description Calculate color and string needed in the ShinyApp valueBoxOutput based on a turfeffect model output
#'
#' @param model An object of class lm, generated by the turfeffect function
#' @param type A string
#'
#' @return x, a list with the first element (x$x) containing the string of slope and p value, and a second element (x$color) containing the color that the valueBox should have
#'
#' @export
#'
valueBoxString <- function(model, type = NULL) {
est = model$estimate
p = model$p
x <- paste("Efecto = ", formatC(est, digits = 2, format = "f"), "; p = ", formatC(p, digits = 2, format = "f")
)
return(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.