knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) library(jsvm) # Clear out README figure files before rerendering readme_figs <- Sys.glob(file.path("man", "figures", "README-*")) file.remove(readme_figs)
jsvm is my personal toolbelt package with functions that I often tend to use or had fun making for some specific purpose.
Install the package from github, using devtools
:
# install.packages("devtools") devtools::install_github("janusvm/jsvm")
Some functions rely on one or more external programs. Not having these programs will not hinder the installation of the package, but some functionality will be missing. The current dependencies are:
expr2tikz()
:pdflatex
to compile standalone tikz figures
(also requires the LaTeX packages fontenc
, xcolor
, tikz
, tikz-qtree
, and inconsolata
to be installed)imagemagick
, for using convert
to make png files of such figurespdf2svg
, for making svg files of such figureswhoami()
: get filename of executing script when run with Rscriptquiet_library()
: convenience function for suppressing all output while loading one or more packagesexpr2tikz()
: plot the AST of an expression with TikZ (tikz-qtree) in the style of the figures in Advanced R: Expressionsexpr2tikz
creates a tikz string, that (when using the LaTeX package tikz-qtree) produces a graph representing the abstract syntax tree of an expression, optionally saving the figure as either a pdf, svg, or png.
filename <- file.path("man", "figures", "README-expr2tikz.svg") expr2tikz(y <- x * 2, filename) knitr::include_graphics(filename)
More functions and examples to come...
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.