R/image.R

Defines functions CreateImageTag

Documented in CreateImageTag

#' Add an image tag (Deprecated)
#'
#' Format an HTML image tag
#'
#' @param src TBD
#' @param alt TBD
#' @export

CreateImageTag <- function(url, alt = NULL){

  #Create tag
  if(is.null(alt)){
    output <- sprintf("<img src=%s></img>", url)
  } else {
    output <- sprintf("<img src=%s alt=%s></img>", url, alt)
  }

  #Class as image
  class(output) <- "image"

  #Return output
  return(output)

}
polymathematic/Longform documentation built on Jan. 16, 2020, 10:12 p.m.