Learn R Programming

exams.forge (version 1.0.10)

tooltip: Tooltip

Description

Adds a text tooltip to the HTML matrix.

Usage

tooltip(x, tooltip = NULL)

add_tooltip(x, tooltip = NULL)

Value

An html_matrix object

Arguments

x

an html_matrix object

tooltip

character: text to show (default: NULL)

Examples

Run this code
library("magrittr")
library("tools")
m    <- matrix(1:12, ncol=4)
hm   <- html_matrix_sk(m, title='', fmt=rep("%f", ncol(m))) %>% 
          add_tooltip(sprintf("Table has %0.f rows and %0.f columns", nrow(.), ncol(.)))
if (interactive()) html <- toHTML(hm, browser=TRUE)

Run the code above in your browser using DataLab