Testing a nice interactive graph created with rCharts & d3, with data from x512paths: NY Times 512 Paths to the White House.
Recreated in R with rCharts and slidify.

For more information, see:

{RR(echo="1" cacheby="pagename")}

  1. Testing rCharts & d3, from

  1. Set a mirror, in case the required packages have dependencies, and those dependencies do not indicate which mirror to install the package from.

r <- getOption("repos")
r"CRAN" <- ""

  1. Update packages first

update.packages(ask = FALSE, repos = '')

  1. if you have not installed slidify, slidifyLibraries, or rCharts

if(!require(devtools)){ install.packages("devtools", repos="") }
require('devtools', quietly = TRUE )
if(!require(slidify)){ install_github('slidify', 'ramnathv', ref = 'dev') }
require(slidify, quietly = TRUE)
if(!require(rCharts)){ install_github('rCharts', 'ramnathv') }
if(!require(codetools)){ install.packages("codetools", repos="") }
require(codetools, quietly = TRUE )
if(!require(slidifyLibraries)){ install_github('slidifyLibraries', 'ramnathv', ref = 'dev') } # optional

  1. get data from downloaded NYT tsv and inject in through params
  2. download repo and unzip to Downloads folder

if(!require(downloader)){ install.packages("downloader", repos="") }
require(downloader, quietly = TRUE )
download( '', '' )

  1. If you are in multitiki, jump 3 directories for the directory to save the files

unzip('', exdir = '../../../public/')

  1. Alternatively, jump just two.
  2. unzip('', exdir = '../../public/')

  1. Set the working directory
  2. If you are in multitiki, jump 3 directories


  1. Alternatively, jump just two.
  2. setwd('../../public/rCharts_512paths-gh-pages')

  1. plot the data

require(rCharts, quietly = TRUE )
data <- read.delim(file = "data/states.tsv")
p1 <- rCharts$new()
p1$field("lib", "libraries/widgets/x512paths")
p1$set(data = toJSONArray(data), dom = NULL)

  1. We have to fix some relative path which seems to be wrong for its equivalent absolute path

p1$LIB2 <- paste("", "/", p1$lib, sep="")
p1$templates$script <- paste(p1$LIB2, p1$templates$script, sep="")

  1. Here we don't create the chart on the fly with a random page name in an uncontroled directory server side, but instead, we save the p1 object as html page ni a defined-by-us path & filename.
  2. Path, by default, is the working directory
  3. p1


Now we show the chart in this wiki page through an iframe:

{iframe name="myChart" width="1000" height="1200" align="middle" frameborder="0" marginheight="0" marginwidth="0" scrolling="auto" src="temp/public/rCharts_512paths-gh-pages/mychart.html"}

Erreur Plugiciel en attente d'approbation

Ce plugiciel a été ajouté/modifié récemment. Son exécution ne sera pas possible avant que l'éditeur de site ne valide ces paramètres.