Last data update: 2014.03.03

R: Display your favourite XKCD comic in R
getXKCDR Documentation

Display your favourite XKCD comic in R

Description

This function fetches a XKCD comic strip (randomly or by number) and displays it on screen.

Usage

  getXKCD(which = "current", display = TRUE, html = FALSE,
    saveImg = FALSE)

Arguments

which

string: either "current" or "random"; or a number indicating the specific strip.

display

logical; TRUE (default) if you like to display the strip on the screen

html

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

saveImg

logical; TRUE if you want to save image in the current directory. Default FALSE

Value

a list containing the following fields:

  • imgURL of the XKCD comic strip image (png)

  • title Title of the XKCD comic strip

  • month

  • numNumber of the XKCD comic strip

  • link

  • year Year of publication

  • safe_title

  • transcript

  • alt

  • day

References

http://xkcd.com/license.html

Examples

library("RXKCD")
significant <- getXKCD(882, display=FALSE)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(RXKCD)
Loading required package: RJSONIO
Loading required package: png
Loading required package: jpeg
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/RXKCD/getXKCD.Rd_%03d_medium.png", width=480, height=480)
> ### Name: getXKCD
> ### Title: Display your favourite XKCD comic in R
> ### Aliases: getXKCD
> 
> ### ** Examples
> 
> library("RXKCD")
> significant <- getXKCD(882, display=FALSE)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>