library(slickR)
Since the carousel can accept any html element we can place iframes in the carousel.
There are times when you may want to put in different DOMs rather than an image in slick.
Using slideType
you can specify which DOM is used in the
slides.
For example lets put the help Rd files from ggplot2 into a slider
using the helper function getHelp
.
Dont forget to open the output to a browser to view the iframe contents
<- function(fn,pkg){
get_help
<- get('index.search',envir = asNamespace('utils'))(
ff topic = fn,
paths = find.package(pkg),
TRUE)
<- dirname(ff)
path <- dirname(path)
dirpath <- basename(dirpath)
pkgname <- file.path(path, pkgname)
RdDB
paste0(
::capture.output({
utils::Rd2HTML(
toolsRd = get('fetchRdDB', envir = asNamespace('tools'))(RdDB, basename(ff))
)
}),collapse='\n')
}
stats
<- lapply(
help_files ls("package:stats",pattern = '^r')[-1],
get_help,pkg = 'stats')
::slickR(help_files,
slickRslideType = 'iframe',
height = 400,
width='95%') +
settings(dots = TRUE,
slidesToShow = 2,
slidesToScroll = 2)