details: Create HTML DOM Details

Description Usage Arguments Details Value See Also Examples

View source: R/details.R

Description

Create HTLM DOM Details block for Markdown documents with summary as optional.

Usage

1
2
3
details(object, ..., summary = NULL, tooltip = "Click to Expand",
  open = FALSE, lang = "r", output = c("console", "clipr", "edit",
  "character"), imgur = TRUE)

Arguments

object

object, object to put in details block

...

arguments to pass to print method of the object

summary

character, text to put in summary block, Default: NULL

tooltip

character, text for tooltip on the summary, Default: 'Click to Expand'

open

logical, is the details open (TRUE) or closed (FALSE), Default: FALSE

lang

character, language of block (for markdown highlighting) Default: 'r'

output

character, where to output the file console (Default), clipboard or R file editor, Default: c('console','clipr','file.edit','character')

imgur

logical, upload device outputs to imgur, Default: TRUE

Details

To remove summary or tooltip set them to NULL. If the object is a file path, it will automatically it's lines will be read in internally.

If lang is NULL then the output will not be wrapped in a code block and will display the raw output (useful for HTML)

When using details in knitr/rmarkdown documents there is no need to set the results to 'asis', there are already predefined print methods for these environments.

... is passed to objects that do not invoke an image device.

Value

character

See Also

use_details

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#basic
 details::details('test')

#sessionInfo
 details::details(sessionInfo(), summary = 'sessionInfo')

#data.frame
 details::details(head(mtcars))

#plots

 details(
   plot(x = mtcars$mpg, y = mtcars$wt),
   summary = 'Plots')


#output options

#character
 details::details('test', output = 'character')

#clipboard
if(clipr::clipr_available()){

 details::details('test', output = 'clipr')

 clipr::read_clip()

}

#file.edit


 details::details('test', output = 'edit')
 

details documentation built on Jan. 12, 2020, 6:19 p.m.