Learn R Programming

Kmisc (version 0.2.0)

html: HTML Tags

Description

This is an environment containing R functions useful in generating HTML tags. See examples for usage.

Arguments

format

An environment of functions, with names corresponding to their tag.

Examples

Run this code
## The first argument is interpreted as the 'data' of an HTML element, while
## all further arguments are interpreted as named attributes to pass to
## the HTML tag you're using
data(html)
myName <- "Kevin"
with( html, strong( paste0("Hi, ", myName, "!" ) ) )

with( html, table( class="my-favorite-table",
  tr( td(myName, class="blue") ) )
  )

## See all of the HTML tags currently available
print( objects(html) )

Run the code above in your browser using DataLab