##-------------------------------------------------------------
##
##-------------------------------------------------------------
mensagem = function(pac,
msg,
aviso = NULL,
subtitulo = NULL,
simb = "check")
{
if(missing(msg)) msg = 6L
if(missing(pac)) pac = ""
if(.Platform$OS.type == "unix")
{
simbolo = c(check3 = "\u25C9",
check2 = ">",
check = "\u2714",
dif = "\u256A",
R = "\u211d",
ponto = "\u25CF",
ponto2 = "\u25CB",
warn = "\u26A0",
none = "")
} else {
simbolo = c(check3 = "o",
check2 = ">",
check = "*",
dif = "x",
R = "R",
ponto = "#",
ponto2 = "O",
warn = "!!!",
none = "")
}
if(!any(simb %in% names(simbolo))) simb = "check"
#warning("\nsimb = ",paste(names(simbolo), collapse=", "))
if(msg == 1L)
{
pacotes = paste("\n ", simbolo[simb], pac, collapse = "")
} else {
if(!all(pac == "")) nopkg = paste0("'", pac, "'") else nopkg = ""
pacotes = paste("\n", nopkg, collapse = "")
}#end if
if(is.null(aviso))
{
aviso = c("Loaded packages",
R.Version()$version.string,
"Installation Error",
"Installed Packages - CRAN",
"Detached packages",
"")[msg]
}#end if
if(is.null(subtitulo))
{
subtitulo = c("", "\nPackages is not available in CRAN",
"\nPackages not installed", "", "", "")[msg]
} else {
subtitulo = paste0("\n", subtitulo) #end if
}#end if
if(subtitulo == "")
{
nbs = 3L
} else {
nbs = abs(nchar(subtitulo) - nchar(aviso))
}#end if
npac = max(unlist(lapply(pac, nchar)))
total = nbs + nchar(aviso)
if(total > npac)
{
total = nbs + nchar(aviso)
nbi = total + 5L
} else {
nbs = abs(npac - nchar(aviso))
nbi = npac + 5L
}#end if
barra.s = paste("\u2550\u2550\u2550", aviso,
paste0(rep("\u2550", nbs), collapse = ""))
centro = paste0(subtitulo, pacotes)
barra.i = paste0("\n", paste0(rep("\u00af", nbi), collapse = ""))
if(msg %in% c(1L, 4L))
{
#message("\n")
message(crayon::cyan(barra.s),
paste0(crayon::yellow(subtitulo), crayon::green(pacotes)),
crayon::cyan(barra.i))
#message("\n")
} else {
#message("\n")
message(crayon::yellow(barra.s),
paste0(crayon::red(crayon::bold(subtitulo)), crayon::cyan(pacotes)),
crayon::yellow(barra.i))
#message("\n")
}#end if
}#end function mensagem
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.