as.htmlimg: Place a filename or filepath in the format used by HTML

Description Usage Arguments Value Author(s) See Also Examples

View source: R/as.htmlimg.R

Description

Place a filename or filepath in the format used by HTML, by surrounding it with "<img src" and "/>" and with possible additional arguments between.

Usage

1
as.htmlimg(object, height = "80", width = NULL, wd = getwd(), align = "middle")

Arguments

object

Vector of character strings containing filenames.

height, width

Number of pixels as a character string.

wd

The directory in which the files reside. The default is the current working directory that R is using.

align

Specifies the alignment of an image according to surrounding elements (Not supported in HTML5). One of the strings: "top", "bottom", "middle", "left", "right"

Value

A character vector containing the input strings surrounded by "<img src" and "/>" and with possible additional arguments between.

Author(s)

Nooreen Dabbish <nerd@temple.edu> and Richard M. Heiberger <rmh@temple.edu>

See Also

microplot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
as.htmlimg("abcd.png")
as.htmlimg("abcd.png", wd=".")
as.htmlimg(c("abcd.png", "efgh.png"))
cat( as.htmlimg("abcd.png")                , "\n")
cat( as.htmlimg("abcd.png", wd=".")        , "\n")
cat( paste(as.htmlimg(c("abcd.png", "efgh.png")), "\n"))

## For an example in context, please see the package example:
##    system.file(package="microplot", "examples/irisRMarkdownHtml.Rmd")
## Copy file irisRMarkdownHtml.Rmd to a directory in which you have write privileges.
## Run the statement
##   rmarkdown::render("irisRMarkdownHtml.Rmd", output_file="irisRMarkdownHtml.html")
## at the R Console.

microplot documentation built on Nov. 29, 2020, 1:07 a.m.