This function fetches a XKCD comic strip (randomly or by number) and displays it on screen.
string: either "current" or "random"; or a number indicating the specific strip.
logical; TRUE (default) if you like to display the strip on the screen.
logical; TRUE if you like to open the XKCD web page for the selected comic in your browser: if TRUE it sets display and saveImg arguments to FALSE. Default FALSE.
logical; TRUE if you want to save image in the current directory. Default FALSE.
Old R versions may have problems accessing HTTPS URLs such as
those used on the XKCD website. In case the default method of
download.file fails, alternatives will be tried. For
the best chance to succeed, ensure that the command line tools
"curl" as well as the
package are installed.
a list containing the following fields:
img URL of the XKCD comic strip image (png)
title Title of the XKCD comic strip
num Number of the XKCD comic strip
year Year of publication
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.