<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-and-learning-materials-for-data-visualization/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://kieranhealy.org/blog/archives/2018/12/12/teaching-and-learning-materials-for-data-visualization/"> R on kieranhealy.org</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<figure>
<img alt="Data Visualization cover" src="https://i1.wp.com/kieranhealy.org/files/misc/dv-cover-pupress.jpg?w=456" data-recalc-dims="1"><br>
</figure>
<p><a rel="nofollow" href="https://amzn.to/2vfAixM" target="_blank">Data Visualization: A Practical Introduction</a> will begin shipping next week. I’ve written an R package that contains datasets, functions, and a course packet to go along with the book. The <code>socviz</code> package contains about twenty five datasets and a number of utility and convenience functions. The datasets range in size from things with just a few rows (used for purely illustrative purproses) to datasets with over 120,000 observations, for practicing with and exploring.</p>
<p>A course packet is also included the package. This is a zipped file containing an <a rel="nofollow" href="http://rstudio.com/" target="_blank">R Studio</a> project consisting of nine <a rel="nofollow" href="http://rmarkdown.rstudio.com/" target="_blank">R Markdown</a> documents that parallel the chapters in the book. They contain the code for almost all the figures in the book (and a few more besides). There are also some additional support files, to help demonstrate things like reading in your own data locally in R.</p>
<h2>Installing the package</h2>
<p>To install the package, you can follow the instructions in the Preface to the book. Alternatively, first download and install R for <a rel="nofollow" href="https://cran.r-project.org/bin/macosx/" target="_blank">MacOS</a>, <a rel="nofollow" href="https://cran.r-project.org/bin/windows/" target="_blank">Windows</a> or <a rel="nofollow" href="https://cran.r-project.org/bin/linux/" target="_blank">Linux</a>, as appropriate. Then download and install <a rel="nofollow" href="http://rstudio.com/download/" target="_blank">RStudio</a>. Launch RStudio and then type the following code at the Console prompt (<code>></code>), hitting return at the end of each line:</p>
<div>
<pre><code data-lang="r">

my_packages <span>&lt;-</span> <span>c</span><span>(</span><span>&quot;tidyverse&quot;</span><span>,</span> <span>&quot;fs&quot;</span><span>,</span> <span>&quot;devtools&quot;</span><span>)</span>
install.packages<span>(</span>my_packages<span>)</span>


devtools<span>::</span>install_github<span>(</span><span>&quot;kjhealy/socviz&quot;</span><span>)</span>
</code></pre>
</div>
<p>Once everything has downloaded and been installed (which may take a little while), load the <code>socviz</code> package:</p>
<div>
<pre><code data-lang="r">
<span>library</span><span>(</span>socviz<span>)</span>
</code></pre>
</div>
<h2>The Course Packet</h2>
<p>The supporting materials are contained in a compressed <code>.zip</code> file. To extract them to your Desktop, make sure the <code>socviz</code> package is loaded as described above. Then do this:</p>
<div>
<pre><code data-lang="r">

setup_course_notes<span>()</span>

</code></pre>
</div>
<p>This will copy the <code>dataviz_course_notes.zip</code> file to your Desktop, and uncompress it into a folder called <code>dataviz_course_notes</code>. Double-click the file named <code>dataviz.Rproj</code> to launch the project as a new RStudio session. If you want to uncompress the file somewhere other than your Desktop, e.g. your Documents folder, you can do this:</p>
<div>
<pre><code data-lang="r">

setup_course_notes<span>(</span>folder <span>=</span> <span>&quot;~/Documents&quot;</span><span>)</span>

</code></pre>
</div>
<p>The source code for <code>socviz</code> is <a rel="nofollow" href="https://github.com/kjhealy/socviz" target="_blank">available on GitHub</a>. I plan on continuing to update and improve it as I use it myself in my own classes and workshops.</p>
	<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://kieranhealy.org/blog/archives/2018/12/12/teaching-and-learning-materials-for-data-visualization/"> R on kieranhealy.org</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/pGeTdZ6GGkA" height="1"></a></div>