3

I am trying out slidify after downloading the required packages from github as stated in this document on getting started with Slidify. After creating the deck with create_deck() I used the function slidify() on a test code that I found online. This is the code:

--- 

### A Simple Plot

Let us create a simple scatterplot.

```{r simple-plot, fig.height = 6, fig.align = 'center', message = F}
require(ggplot2)
qplot(wt, mpg, data = mtcars)
```

--- 

### A Table

```{r table, results = 'asis', comment = NA}
library(xtable)
options(xtable.type = 'html')
xtable(head(mtcars))
```

I saved the above code as test_slidify.Rmd and called it using slidify("test_slidify.Rmd"). However, I keep running into the following error, at the end below:

processing file: C:/Users/VJ/test_slidify.Rmd
  |>>>>>>>>>>>>>                                                    |  20%
  ordinary text without R code

  |>>>>>>>>>>>>>>>>>>>>>>>>>>                                       |  40%
label: simple-plot (with options) 
List of 4
 $ fig.height: num 6
 $ fig.align : chr "center"
 $ message   : logi FALSE
 $ indent    : chr "    "

  |>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>                          |  60%
  ordinary text without R code

  |>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>             |  80%
label: table (with options) 
List of 3
 $ results: chr "asis"
 $ comment: logi NA
 $ indent : chr "    "

  |>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>| 100%
  ordinary text without R code


output file: C:\Users\VJ\test_slidify.md

Error in mapply(function(i, j) doc[i:j], begin, end, SIMPLIFY = FALSE) : 
  Zero-length inputs cannot be mixed with those of non-zero length

I have downloaded the most recent version of slidify and other required packages, but still keep running into this error. Appreciate any help. Lastly, does slidify create a .md file only or a html file like in a regular Rmarkdown with knitr. How do we convert the generated .md file into a html file.

Ramnath
  • 54,439
  • 16
  • 125
  • 152
Vijay Ivaturi
  • 828
  • 2
  • 8
  • 20
  • I had the same problem ever. Solved it by restarting RStudio...I copied your codes and it works in my laptop. – Elaine Oct 28 '12 at 23:05

1 Answers1

1

I experienced the same problem by coping and pasting from the example on the Slidify website. This messed up the text encoding, causing a fault. I ended up typing the example by hand, and then it built the html file perfectly. Also note, that you need to use '---' syntax (without the quotes) to separate the slides. Not doing so caused other people's builds to crash.

Jay B. Martin
  • 499
  • 4
  • 11