How to Make HTML5 Slides with knitr | Yihui Xie | /en/2012/05/how-to-make-html5-slides-with-knitr/
How to Make HTML5 Slides with knitr | Yihui Xie
https://yihui.org/en/2012/05/how-to-make-html5-slides-with-knitr/
https://yihui.org/en/2012/05/how-to-make-html5-slides-with-knitr/
Guest *Bob Dobbs* @ 2012-05-01 23:53:09 originally posted:
you are a god among men. this is great!
Guest *baptiste auguie* @ 2012-05-02 02:47:10 originally posted:
Nice! For some reason the html5 slides give me only a black page with nothing on it, either in Chrome or Firefox.
There is something wrong with Github, and the file was corrupted for some reason, so you can probably get one version by yourself from knitr + pandoc. Currently I'm testing under Windows, and I will update the link later when I switch back to Ubuntu.
Originally posted on 2012-05-02 02:53:49
Guest *vzemlys* @ 2012-05-02 03:25:30 originally posted:
Thanks for the howto!
Guest *Jared Knowles* @ 2012-05-02 03:29:06 originally posted:
Thank you for this great tutorial and for your development work. The knitr package is a great tool that allows for collaboration with non LaTeX or non Sweave users--which makes R much easier to use within a large enterprise.
I'm happy to know it is also used in enterprises.
Originally posted on 2012-05-02 03:44:38
Guest *Jared Knowles* @ 2012-05-02 18:13:32 originally posted:
I hope to see how to make it easier to use in an enterprise. I work for a state agency and we have really tried to use R more and more in the hopes of collaborating on data reports. Format flexibility from a tool like knitr+pandoc makes this much easier!
Guest *liyun* @ 2012-05-02 07:47:40 originally posted:
you should present it again in China-R conference! Make the world flat please :)
Taiyun will do it.
Originally posted on 2012-05-02 18:51:57
Guest *Lluís Ramon* @ 2012-05-02 18:16:46 originally posted:
Impressive!!
From now on I will use R markdown + Pandoc. No excuses for non-reproducible research.
Thanks a lot.
Guest *Mao Jianfeng* @ 2012-05-03 07:19:27 originally posted:
What a great tool. Thanks a lot to Yihui. Some quick problems. I am curious that how the font/fig size could be controlled with kintr. And, how about choosing different fonts, colors for texts?
Are you talking about LaTeX or HTML? For figure sizes, see http://yihui.name/knitr/options For font size, see http://yihui.name/knitr/demo/beamer/ for an example (but do you really need to change the font size?) For other styles, see https://github.com/downloads/yihui/knitr/knitr-themes.pdf
I do not think you should worry about these issues in the beginning, unless you know really well about LaTeX or HTML/CSS. If you feel unsatisfied about the default styles, please let me know specifically which part(s) you do not like, otherwise I recommend you to focus on the content. I have worked hard on making reasonable default styles.
Originally posted on 2012-05-03 18:31:00
Guest *Xavier de Pedro* @ 2012-05-03 07:57:11 originally posted:
Thanks Yihui Xie, this looks very nice, and also integrated with RStudio: awesome!
For your information, anyway, since 2011 there is another way of approaching this goal.
The other approach that we took is about using some stable and free/open source application called "Tiki" to handle the web side of it, and use simple wiki syntax (wiki-wiki = quick, in hawaian) for the markup. This (with other seasonings) is the recipe for the success of Wikipedia. And we took that approach to extend the capabilities of Tiki to allow creating custome reports (or web interfaces) for R scripts and packages.
It was presented in last UseR 2011 in UK, using , by the way, the integrated easy slideshow system, so that you can also run R code and get the output in your slides (or web pages) safely through Tiki + PluginR + Slideshow (jquery.s5 modern slideshow system)
For instance, the text used for that talk was written using wiki syntax (from any browser, not even Rtudio needed nor emacss nor anything else)
http://ueb.vhir.org/tools/2011+UseR
And then that text is shown through some javascript and css as a slideshow:
http://ueb.vhir.org/tools/show:2011+UseR#s1
More information about the whole process of the slideshow:
https://doc.tiki.org/PluginSlideshow
More information about PluginR:
https://doc.tiki.org/PluginR
Cheers
Xavier de Pedro, Ph.D.
Guest *Jonathan Keane* @ 2012-05-06 19:22:32 originally posted:
This looks great. I'm excited for the rstudio integration. I'm wondering if anybody has found a good solution for generating a pdf version from the dz slides output? I know it shouldn't really be necessary, but it would be good to have more static, single file that can be distributed alongside the resulting html file.
One solution is that I could just have pandoc generate a beamer version as well as dzslide versions, but that is not ideal.
I do not know other approaches except converting it to other formats like Beamer PDF or an ordinary HTML document... HTML slides are probably not designed for printing.
Originally posted on 2012-05-06 19:38:28
Guest *ptb* @ 2012-05-10 03:12:27 originally posted:
With the example code here, I got this kind of result:
http://dl.dropbox.com/u/24994281/keeplong/knitr-slides.html
What is missing here?
That is the results created by RStudio; you need to install pandoc and convert the *.md file to HTML5 slides with pandoc; see the command above in my post.
Originally posted on 2012-05-10 03:17:40
Guest *linweit* @ 2012-05-10 03:23:46 originally posted:
Thanks so much!
Guest *Stephan* @ 2012-05-12 21:42:01 originally posted:
Yihui, thanks a lot for great work!
I have one detailed question: How can I supress the automatic upload of images/graphics? I deleted the line
opts_knit$set(upload.fun = imgur_upload)from the above example - and still I find the .png being uploaded (scatterplot of cars).I am grateful for any hint -and I'm lokking forward to the work that you're doing on knitr!/Stephan
That should not be the case. Did you try to compile the document from a new R session? The plots should not be uploaded by default.
Originally posted on 2012-05-12 22:18:27
Guest *Stephan* @ 2012-05-13 05:31:38 originally posted:
Dear Yihui, I did start new, and now it works. Guess it has sth wit caching. Now image-adress is lie "data:image/png;base64,iVBOR...". I'm not familiar with the caching, but I assume this refers to the figure Folder, right?
Will need to learn more :)
That is expected. It is a special feature in RStudio, which encodes plots in base64 strings so that when you publish the HTML file, you do not need to copy all the plots to the server (i.e. the HTML file is completely self-contained).
It has nothing to do with cache.
Originally posted on 2012-05-14 02:32:30
Guest *Xingyu Pan* @ 2012-10-17 18:05:36 originally posted:
Thanks for the helpful information. A question though, do you know if there is any R package which allows online interactions? E.g. viewers can type in the value of the parameter and they can get the output (number, or plot), hence remove their needs to do the programming themselves? Thank you!
Guest *Xavier de Pedro* @ 2012-10-18 07:42:30 originally posted:
Hi Xingyu:Yes, there is. You can use Tiki ( https://tiki.org ) + PluginR ( https://doc.tiki.org/PluginR ) to create Web 2.0 Interfaces for your R scripts and packages. Using FLOSS tools :-)In addition, you can use a mature wiki (=quick) syntax, in a similar way to markdown, get code highlighted and self-indented while editing and when posted, etc. And you can also do your online interactive presentations with the bundled Tiki slideshow feature (availabe there for a few years already). All in one single mature secure software program. Presented in UseR!2011 (UK), and intending to hold a workshop/face-to-face-tutorial about it in UseR!2013 (Spain), similar to this one held in Spanish a year ago: http://ueb.vhir.org/2011+R-es+Taller+5I hope this helps.Cheers
There are actually plenty of packages to use. The most easy-to-use package so far, in my eyes, is the shiny package developed by RStudio, but I probably should not tell you much about it since it is still under active development. I'll blog about it when it is considered mature.
Other options include rApache, Rook, Rserve, fastRWeb, ...
Originally posted on 2012-10-19 04:56:02
Guest *MelonXu* @ 2013-01-11 16:07:20 originally posted:
Hi Yihui, thanks a million for the excellent tutorial. I have trouble with figures. Figures are automatically stored in /figure folder, it shows fine on .html, but when I pandoc the .md file, figures are missing. Same thing happens if I convert .tex to .docx using pandoc. They simply can not find my figure folder :( Any suggestion? Thank you very much.
Show me the .md file please, e.g. paste it in pastebin.com
Originally posted on 2013-01-11 17:51:33
Guest *MelonXu* @ 2013-01-11 17:59:46 originally posted:
What is your working directory? Is figure/unnamed-chunk-2.png under your working directory?
Originally posted on 2013-01-11 23:02:00
Guest *MelonXu* @ 2013-01-14 14:26:05 originally posted:
Yes. I first changed my working directory to where .md file sits, then 'pandoc'. Figures are automatically stored in the sub folder 'figure'. I also tried to copy the figure into the same folder with .md file, and change the corresponding line in .md file to (unnamed-chunk-2.png). It still didn't work...
This is weird. I do not understand it, and I cannot reproduce it either.
Originally posted on 2013-01-14 20:19:33
Guest *Zak* @ 2014-06-14 02:11:42 originally posted:
I have the exact same problem. I can't even produce the most basic example using 'plot(cars)'. It just does not plot.
You can forget about this two-year-old post now -- we have made the whole thing a lot easier; please see http://rmarkdown.rstudio.com
Originally posted on 2014-06-14 04:15:47
Guest *CY* @ 2013-04-02 20:15:41 originally posted:
Yihui,
You are awesome. Your work is awesome. You define awesomeness.
Guest *Kabir Olorede* @ 2014-06-16 08:37:47 originally posted:
Yihui,
My Knitr experience is great. Knitr is a great eye opener and
nice contribution to knowledge. I have turned finally to knitr with
markdown for my Statistics lectures and talks within R studio. But I
have one simple challenge with R scan() function. I cannot use the scan
function between <<>> and @. It doesn't work in my R
presentation with {r} and . Please help.
Kabir,
Kwara State University,Nigeria
Please see http://stackoverflow.com/questions/11248705/knitr-fail-compiling-chunk-with-scandec
Originally posted on 2014-06-21 03:29:01
Sign in to join the discussion
Sign in with GitHub