Special Details

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(details)

You can wrap print methods of R objects in a details environment.

  1. data.frame
  2. tibble
  3. list
  4. plots
  5. tables

data.frame

 iris%>%
  details::details(summary = 'data.frame')

tibble

 iris%>%
  tibble::as_tibble()%>%
  details::details(summary = 'tibble')

list

 list(a = 1,b = head(iris))%>%
  details::details(summary = 'list')

plots

Plots can be rendered and uploaded to imgur (default) or read in from a local path. In this example we use a local path in order to abuse the host site.

details(
  plot(x=mtcars$mpg,y=mtcars$wt),
  summary = 'plots',
  imgur = FALSE)

tables

Tables can be wrapped in a details block by setting the lang to 'none'

iris%>%head()%>%knitr::kable()%>%
  details(
    summary = 'tables',
    lang = 'none'
)


Try the details package in your browser

Any scripts or data that you put into this service are public.

details documentation built on March 28, 2022, 1:06 a.m.