<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/teaching-an-advanced-r-course/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://privefl.github.io/blog/teaching-an-advanced-r-course/"> Florian Privé</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<section>
<p>In this post, I come back to my first experience teaching an advanced R course over the past month.</p>
<p><a rel="nofollow" href="https://privefl.github.io/advr38book/" target="_blank"> <img src="https://i1.wp.com/privefl.github.io/blog/images/learnR.png?w=50%25&ssl=1" data-recalc-dims="1"> </a></p>
<div>
<h2>Content</h2>
<p>This course was programmed for 10 sessions (3 hours each) and I initially wanted to talk about the following subjects:</p>
<ol>
<li>
<p>R programming and good practices (2 sessions)</p>
</li>
<li>
<p>Data analysis with the tidyverse (3 sessions)</p>
</li>
<li>
<p>R code performance (2 sessions)</p>
</li>
<li>
<p>R packages (2 sessions)</p>
</li>
<li>
<p>Bonus: Shiny (1 session)</p>
</li>
</ol>
<p>I basically sticked to this.</p>
<p>I should also mention the public: PhD students.</p>
</div>
<div>
<h2>Materials</h2>
<p>At first, I wanted to do an interactive course using package <a rel="nofollow" href="https://rstudio.github.io/learnr/" target="_blank">{learnr}</a> but it would have required way too much work (my thesis supervisor would not have been happy!). So, finally I decided to use package <a rel="nofollow" href="https://bookdown.org/yihui/bookdown/" target="_blank">{bookdown}</a>. Using {bookdown} was really easy, and knowing how to use it now will spare me some time when I will write my thesis manuscript.</p>
<p>Materials are available <a rel="nofollow" href="https://privefl.github.io/advr38book/index.html" target="_blank">there</a>.</p>
<p>I also decided to create an associated package for mainly two reasons:</p>
<ul>
<li>
<p>to make students install package dependencies that we needed in this course,</p>
</li>
<li>
<p>to make solutions available for <a rel="nofollow" href="https://privefl.github.io/advr38book/performance.html" target="_blank">the chapter on code performance</a>.</p>
</li>
</ul>
<p>This idea of having a bookdown for materials with an associated package is not new (e.g. see <a rel="nofollow" href="https://bookdown.org/csgillespie/efficientR/" target="_blank">the <em>Efficient R Programming</em> book</a> and <a rel="nofollow" href="https://github.com/csgillespie/efficient" target="_blank">its associated package</a>).</p>
<p>I also introduced my students to <a rel="nofollow" href="https://slack.com/" target="_blank">Slack</a> so that we could communicate and share code.</p>
</div>
<div>
<h2>All chapters</h2>
<ol>
<li>
<p>I started the course with <a rel="nofollow" href="https://privefl.github.io/advr38book/good-practices.html" target="_blank">good practices</a> such as coding style, using RStudio and Git, and getting help.</p>
</li>
<li>
<p>I continued the course with some <a rel="nofollow" href="https://privefl.github.io/advr38book/r-programming.html" target="_blank">base R programming</a>. This is not the funniest part of the course, but knowing this seemed to me as inevitable to be proficient in R.</p>
</li>
<li>
<p>Then, <a rel="nofollow" href="https://privefl.github.io/advr38book/tidyverse.html" target="_blank">we learned about the tidyverse</a> using <a rel="nofollow" href="http://r4ds.had.co.nz/" target="_blank">the R for Data Science book</a>. While teaching this course, I have discovered that many people still don’t use {ggplot2} and {dplyr}. So, I had to introduce these two packages from scratch and it took me longer than I had anticipated. In 3 sessions (9h), I had the time to cover R Markdown, {ggplot2} and {dplyr} only.</p>
</li>
<li>
<p>After the tidyverse, I covered <a rel="nofollow" href="https://privefl.github.io/advr38book/performance.html" target="_blank">performance of R code</a>. I really like to solve performance problems on Stack Overflow and (I think) I’m really good at it. So, this may have been the chapter I could bring the most to the table. Moreover, one student came with one of the problem she had, and I used her problem as an exercise. At the end, she was able to make her code more than 1000 times faster. For the other exercises, I mainly used problems I had answered on Stack Overflow.</p>
</li>
<li>
<p>For the last chapter, we covered <a rel="nofollow" href="https://privefl.github.io/advr38book/packages.html" target="_blank">how to make an R package</a>. I showed them that it was really easy and fast, mainly thanks to packages {usethis} and {roxygen2}. We had time to cover the full documentation, testing, automatic checking of packages and even how to make a website of a package.</p>
</li>
<li>
<p>Finally, the last session was a “bonus” session we could use either to spend more time on any topic or just to learn something fun like {Shiny}. Indeed, we could have spent at least two more sessions on the tidyverse and one on practicing about performance of R code. Using a <a rel="nofollow" href="https://simplepoll.rocks/" target="_blank">Slack poll</a>, we agreed to <a rel="nofollow" href="https://privefl.github.io/advr38book/shiny.html" target="_blank">learn Shiny</a>. For this, I used <a rel="nofollow" href="https://www.datacamp.com/courses/building-web-applications-in-r-with-shiny?tap_a=5644-dce66f&tap_s=10907-287229" target="_blank">this nice and free DataCamp course</a>.</p>
</li>
</ol>
</div>
<div>
<h2>Retrospective thoughts</h2>
<ol>
<li>
<p>At least half of the materials I used is borrowed from others. At first, I felt bad about this because I felt lazy. But it has already taken me a lot of time to prepare these materials, just reinventing the wheel with some new materials that were already out there would have not been good for me or my students.</p>
</li>
<li>
<p>I think using {bookdown}, Git and Slack was a good idea.</p>
</li>
<li>
<p>I feel like I’ve covered lots of useful things. However, I would have wanted my course to be useful for more people (I had only ~10 students). Hopefully these materials will be useful for other people outside Grenoble, France.</p>
<p>So don’t hesitate to comment this post or ask some questions!</p>
</li>
</ol>
</div>
</section>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://privefl.github.io/blog/teaching-an-advanced-r-course/"> Florian Privé</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/05rz_GsUfNg" height="1"></a></div>