Installing Slidify on a Windows Machine

I’ve been wanting to try out the amazing Slidify package developed by Ramnath Vaidyanathan for a while. What it does is generate html slide shows directly from R, using R markdown. Turns out it was the perfect entertainment for someone down with a flu on a very hot summer weekend.

I followed the instructions described here, but ran into a few problems. Google-fu only gave me one closed discussion thread with someone else having the same problem, which was solved by upadting to R 2.15.2.

Since I was already on R 2.15.2, that wasn’t much help. But, as Ramnath mentioned in that thread, it’s mostly a problem with install_github, and building it from source worked for me. So, if you have never built an R package from source (like I didn’t), this post will hopefully save you a few hours.

Step 0: My session info, just for reference

> sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] devtools_1.1

loaded via a namespace (and not attached):
[1] digest_0.6.0    evaluate_0.4.2  httr_0.2        memoise_0.1     parallel_2.15.2 plyr_1.7.1     
[7] RCurl_1.95-3    stringr_0.6.1   tools_2.15.2    whisker_0.1 

Library path is C:/Users/Thiago Silva/Documents/R/win-library/2.15

Step 1: Download and install Rtools

I grabbed it from here, Version 3.0, ran the executable, no hassle.

Step 2: Install devtools

At the R command prompt:

install.packages('devtools')

No hassle either.

Step 3: Install slidify from Github, using devtools

As suggested on Ramnath’s page, all smooth.

install_github("slidify", "ramnathv")

Step 4: Install slidifyLibraries

This is where the problems began. Using the recommended install_github method gave me the following error:

> install_github("slidifyLibraries", "ramnathv")
Installing github repo(s) slidifyLibraries/master from ramnathv
Installing slidifyLibraries.zip from https://github.com/ramnathv/slidifyLibraries/archive/master.zip
Installing slidifyLibraries
"C:/PROGRA~1/R/R-215~1.2/bin/x64/R" --vanilla CMD build "C:\Users\Thiago  \
  Silva\AppData\Local\Temp\Rtmp8esQJH\slidifyLibraries-master" --no-manual --no-resave-data 

* checking for file 'C:\Users\Thiago Silva\AppData\Local\Temp\Rtmp8esQJH\slidifyLibraries-master/DESCRIPTION' ... OK
* preparing 'slidifyLibraries':
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building 'slidifyLibraries_0.1.tar.gz'

Warning in utils::tar(filepath, pkgname, compression = "gzip", compression_level = 9,  :
  storing paths of more than 100 bytes is not portable:
  'slidifyLibraries/inst/libraries/frameworks/landslide/themes/machinalis/fonts/OFLGoudyStMTT-Italic.ttf'

(I got a lot of these warnings, only showing first and last)

Warning in utils::tar(filepath, pkgname, compression = "gzip", compression_level = 9,  :
  storing paths of more than 100 bytes is not portable:
  'slidifyLibraries/inst/libraries/widgets/mathjax/jax/output/SVG/fonts/TeX/Typewriter/Regular/CombDiacritMarks.js'

"C:/PROGRA~1/R/R-215~1.2/bin/x64/R" --vanilla CMD INSTALL  \
  "C:\Users\THIAGO~1\AppData\Local\Temp\Rtmp8esQJH/slidifyLibraries_0.1.tar.gz"  \
  --library="C:/Users/Thiago Silva/Documents/R/win-library/2.15" --with-keep.source 

Warning in max(which(block[1:100] > 0)) :
  no non-missing arguments to max; returning -Inf
Warning in rawToChar(block[seq_len(ns)]) : NAs introduced by coercion
Error in seq_len(ns) : argument must be coercible to non-negative integer


Error: Command failed (1)

Step 5) Install slidifyLibraries from Windows command prompt

Since the above didn’t work, I took matters in my own hands. First, I built the package from source using devtools. I downloaded it from Ramnath’s repository as a Zip file, then extracted it and removed the “-Master” from the main folder name (no idea if renaming matters or not, to be honest).

build("C:/Users/Thiago Silva/Downloads/slidifyLibraries/", binary=FALSE)

This gave me a file named “slidifyLibraries_0.1.tar.gz”. Once I had it, I opened a command prompt window, navigated to the folder where the file was, and typed:

R CMD INSTALL slidifyLibraries -l "C:\Users\Thiago Silva\Documents\R\win-library\2.15"

Don’t forget to change the path to your own R library path! The following happened:

R CMD INSTALL slidifyLibraries -l "C:\Users\Thiago Silva\Documents\R\win-library\2.15"

* installing *source* package 'slidifyLibraries' ...
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64

* DONE (slidifyLibraries)

And, voilá, it worked (for me). I now have my first slidify presentation. Success!

P.S.- If your Dropbox path is different from the standard installation (mine is), publish() will throw an error:

> publish('testdeck3', host = 'dropbox')
Creating slide directory at ~/Dropbox/Public/testdeck3
Copying files to ~/Dropbox/Public/testdeck3
[1] FALSE
Warning messages:
1: In file.copy(".", drop_dir, overwrite = F, recursive = TRUE) :
'recursive' will be ignored as 'to' is not a single existing directory
2: In file.create(to[okay]) :
cannot create file '~/Dropbox/Public/testdeck3', reason 'No such file or directory'

I fixed by creating a symbolic link to the actual Dropbox folder, inside my Documents folder, following these instructions (command-prompt option).

Advertisements

About thiagosilva

Ecologist and "Remote Senser", Postdoctoral Fellow at INPE, Brazil.
This entry was posted in News and tagged , , , , , , . Bookmark the permalink.

7 Responses to Installing Slidify on a Windows Machine

  1. Paul says:

    Hi! I got the same error while using slidify, publish(“Hej”, host = “dropbox”). I created a hard symbolic link to my dropbox folder, as you told above. But I still get the same error, as you got…Any idea why?

    Best Regards!
    Paul

  2. Anonymous says:

    Hi Thiago,

    I am running windows on a Mac using Parallels and I am using R on the Windows side. I successfully managed to complete step 4 the point build(“T:/Downloads/slidifyLibraries/”, binary=FALSE) and I get the file slidifyLibraries_0.3.1.tar.gz in my T:/Downloads

    However, when I go to command prompt and change directory to T:\Downloads and then run
    R CMD INSTALL slidifyLibraries -l “T:\Documents\R\win-library\3.0\”
    I get an error that R is not recognised as an internal or external command

    I have even tried to install the slidifyLibraries_0.3.1.tar.gz file from within RStudio as a package archive file but I get the following error

    install.packages(“//psf/Home/Downloads/slidifyLibraries_0.3.1.tar.gz”, repos = NULL, type = “source”)
    Installing package into ‘\\psf/Home/Documents/R/win-library/3.0’
    (as ‘lib’ is unspecified)
    ‘\\psf\Home\Documents’
    CMD.EXE was started with the above path as the current directory.
    UNC paths are not supported. Defaulting to Windows directory.
    * installing *source* package ‘slidifyLibraries’ …
    ** R
    ** inst
    ** preparing package for lazy loading
    ** help
    No man pages found in package ‘slidifyLibraries’
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded
    *** arch – i386
    Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
    there is no package called ‘slidifyLibraries’
    Error: loading failed
    Execution halted
    *** arch – x64
    Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
    there is no package called ‘slidifyLibraries’
    Error: loading failed
    Execution halted
    ERROR: loading failed for ‘i386’, ‘x64’
    * removing ‘\\psf/Home/Documents/R/win-library/3.0/slidifyLibraries’
    Warning in install.packages :
    running command ‘”C:/PROGRA~1/R/R-30~1.2/bin/x64/R” CMD INSTALL -l “\\psf\Home\Documents\R\win-library\3.0” “//psf/Home/Downloads/slidifyLibraries_0.3.1.tar.gz”‘ had status 1
    Warning in install.packages :
    installation of package ‘//psf/Home/Downloads/slidifyLibraries_0.3.1.tar.gz’ had non-zero exit status

  3. Gracias!! excelente!!

  4. Dag Hjermann says:

    Thanks a LOT! This really saved me hours, I am quite sure. I wasn’t able to install neither slidify nor rCharts using install_github.
    I had different problems than you, though. install_github gave the message “there is no package called ‘rCharts'” (after the “testing if installed package can be loaded” message), and find_rtools() responded that “Rtools 3.1 found on the path at C:/Rtools is not compatible with R 3.1.0”. However, your step 5) worked like a charm!

  5. hattricknz says:

    thks for this but i am still struggoing with this. Is it somethin to do with my path name haveing a space “User Name”??

    C:\Users\User Name\Downloads>R CMD INSTALL slidifyLibraries -l “C:\Apps\R-3.1.
    2\library\2.15”
    Error: ERROR: cannot cd to directory ‘C:\Apps\R-3.1.2\library\2.15’

    C:\Users\User Name\Downloads>R CMD INSTALL slidifyLibraries -l “C:\Apps\R-3.1.
    2\library\”
    * installing *source* package ‘slidifyLibraries’ …
    ** R
    ** inst
    ** preparing package for lazy loading
    ** help
    No man pages found in package ‘slidifyLibraries’
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded
    *** arch – i386
    ARGUMENT ‘Name\AppData\Local\Temp\RtmpWm7a9w\Rin1c1419737588’ __ignored__

    Error: unexpected symbol in “ClientRoot is”
    Execution halted
    *** arch – x64
    ARGUMENT ‘Name\AppData\Local\Temp\RtmpWm7a9w\Rin1c1436ce4303’ __ignored__

    Error: unexpected symbol in “ClientRoot is”
    Execution halted
    ERROR: loading failed for ‘i386’, ‘x64’
    * removing ‘C:/Apps/R-3.1.2/library/slidifyLibraries’

    C:\Users\User Name\Downloads>

  6. thiagosilva says:

    Hi folks,

    I am sorry if I can’t be of much help with further errors while installing slidify. I am not a developer myself, and it took me a lot of trial and error and digging the web to be able to do the steps above. I reported them in the hope that someone else could follow the instructions and make it work, but I really don’t know what to do if it doesn’t actually work.

    I haven’t really used slidify since, there is just not enough documentation. I’ve been using the ‘knitr’ package with the Latex ‘beamer’ package (which is not that ugly if you take the time to create some custom slides, and there’s plenty of documentation of that in the web).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s