Generalize import of graphical objects
It would be nice to have a general mechanism for adding graphical objects (like ggplot, highcharts, plotly etc.).
Requirements
- a single template (
inst/templatest/vis_object.Rmd
) that makes use of two additional placeholders ({{ package }}
and{{ class }}
). - the
add_object
function, renamed toadd_vis_object
inR/vis_objects.R
(needs modification to work with the newinst/templatest/vis_object.Rmd
!). - the newly generated method functions in
R/vis_objects.R
(hint: they can be shortened to one-liners).