<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/data-visualization-course-for-first-year-students/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://citizen-statistician.org/2017/10/07/data-visualization-course-for-freshmen/"> R Project – Citizen-Statistician</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>A little over a year ago, we decided to propose a data visualization course at the first-year level. We had been thinking about this for awhile, but never had the time to teach it given the scheduling constraints we had. When one of the other departments on campus was shut down and the faculty merged in with other departments, we felt that the time was ripe to make this proposal.</p>
<div class="wp-caption"><a rel="nofollow" href="http://citizen-statistician.org/2017/10/07/data-visualization-course-for-freshmen/screen-shot-2017-10-07-at-10-24-51-am/" target="_blank"><img sizes="(max-width: 1518px) 100vw, 1518px" src="https://i0.wp.com/citizen-statistician.org/wp-content/uploads/2017/10/Screen-Shot-2017-10-07-at-10.24.51-AM.png?w=450" alt="" class="wp-image-1227" data-recalc-dims="1"></a>
<p class="wp-caption-text">Course description of the EPsy 1261 data visualization course</p>
</div>
<p>In putting together the proposal, we knew that:</p>
<ul>
<li>The course would be primarily composed of social science students. My department, Educational Psychology, attracts students from the <em>College of Education and Human Development</em> (e.g., Child Psychology, Social Work, Family Social Science).</li>
<li>To attract students, it would be helpful if the course would fulfill the University’s Liberal Education (LE) requirement for <em>Mathematical Thinking</em>.</li>
</ul>
<p>This led to several challenges and long discussions about the curriculum for this course. For example:</p>
<ul>
<li>Should the class focus on <strong>producing</strong> data visualizations (very exciting for the students) or on <strong>understanding/interpreting</strong> existing visualizations (useful for most social science students)?</li>
<li>If we were going to produce data visualizations, which software tool would we use? Could this level of student handle R?</li>
<li>In order to meet the LE requirement, the curriculum for the course would need to show a rigorous treatment of students actually “doing” mathematics. How could we do this?</li>
<li>Which types of visualizations would we include in the course?</li>
<li>Would we use a textbook? How might this inform the content of the course?</li>
</ul>
<h1>Software and Content</h1>
<p>After several conversations among the teaching team, with stakeholder departments, and with colleagues teaching data visualization courses at other universities, we eventually proposed that the course:</p>
<ul>
<li>Focus both on students’ being able to read and understand existing visualizations and produce a subset of these visualizations, and</li>
<li>Use R (primary tool) and <a rel="nofollow" href="http://app.rawgraphs.io/" target="_blank">RAWGraphs</a> for the production of these plots.</li>
</ul>
<h2>Software: Use ggplot2 in R</h2>
<p>The choice to use R was not an immediate one. We initially looked at using Tableau, but the default choices made by the software (e.g., to immediately plot summaries rather than raw data) and the cost for students after matriculating from the course eventually sealed its fate (we don’t use it). We contemplated using Excel for a minute (gasp!), but we vetoed that even quicker than Tableau. The <a rel="nofollow" href="http://app.rawgraphs.io/" target="_blank">RAWGraphs website</a>, we felt, held a lot of promise as a software tool for the course. It had an intuitive drag-and-drop interface, and could be used to create many of the plots we wanted students to produce. Unfortunately, we were not able to get the bar graph widget to produce side-by-side bar plots easily (actually at all). The other drawback was that the drag-and-drop interactions made it a harder sell to the LE committee as a method of building students’ computational and mathematical thinking if we used it as the primary tool.</p>
<p>Once we settled on using R, we had to decide between using the suite of <strong>base plots</strong>, or <strong>ggplot2</strong> (<strong>lattice</strong> was not in the running). We decided that <strong>ggplot</strong> made the most sense in terms of thinking about extensibility. Its syntax was based on a theoretical foundation for creating and thinking about plots, which also made it a natural choice for a data visualization course. The idea of mapping variables to aesthetics was also consistent with the language used in RAWGraphs, so it helped reenforce core ideas across the tools. Lastly, we felt that using the ggplot syntax would also help students transition to other tools (such as ggviz or plotly) more easily.</p>
<p>One thing that the teaching team completely agreed on (and was mentioned by almost everyone who we talked to who taught data visualization) was that we wanted students to be producing graphs very early in the course; giving them a sense of power and the reenforcement that they could be successful. We felt this might be difficult for students with the ggplot syntax. To ameliorate this, we wrote a course-specific R package (<a rel="nofollow" href="https://github.com/zief0002/epsy1261" target="_blank">epsy1261; available on github</a>) that allows students to create a few simple plots interactively by employing functionality from the manipulate package. (We could have also done this via Shiny, but I am not as well-versed in Shiny and only had a few hours to devote to this over the summer given other responsibilities.)</p>
<div class="wp-caption"><a rel="nofollow" href="http://citizen-statistician.org/2017/10/07/data-visualization-course-for-freshmen/screen-shot-2017-10-07-at-10-16-24-am/" target="_blank"><img sizes="(max-width: 2124px) 100vw, 2124px" src="https://i1.wp.com/citizen-statistician.org/wp-content/uploads/2017/10/Screen-Shot-2017-10-07-at-10.16.24-AM.png?w=450" alt="" class="wp-image-1226" data-recalc-dims="1"></a>
<p class="wp-caption-text">Interactive creation of the bar chart using the <strong>epsy1261</strong> package. This allows students to input  minimal syntax, barchart(data), and then use interaction to create plots.</p>
</div>
<h2>Course Content</h2>
<p>We decided on a three-pronged approach to the course content. The first prong would be based on the production of common statistical plots: bar charts, scatterplots, and maps, and some variations of these (e.g., donut plots, treemaps, bubble charts). The second prong was focused on reading more complex plots (e.g., networks, alluvial plots), but not producing them, except maybe by hand. The third prong was a group project. This would give students a chance to use what they had learned, and also, perhaps, access other plots we had not covered. In addition, we wanted students to consider narrative in the presentation of these plots—to tell a data-driven story.</p>
<p>Along with this, we had hoped to introduce students to computational skills such as data summarization, tidying, and joining data sets. We also wanted to introduce concepts such as smoothing (especially for helping describe trend in scatterplots), color choice, and projection and coordinate systems (in maps). Other things we thought about were using R Markdown and data scraping.</p>
<h1>Reality</h1>
<p>The reality, as we are finding now that we are over a third of the way through the course, is that this amount of content was over-ambitious. We grossly under-estimated the amount of practice time these students would need, especially working with R. Two things play a role in this:</p>
<ol>
<li>The course attracted way more students than we expected for the first offering (our class size is 44) and there is a lot of heterogeneity of students’ experiences and academic background. For example, we have graduate students from the School of Design, some first years, and mostly sophomores and juniors. We also have a variety of majors including, design, the social sciences, and computer science.</li>
<li>We hypothesize that students are not practicing much outside of class. This means they are essentially only using R twice a week for 75 minutes when they are in class. This amount of practice is too infrequent for students to really learn the syntax.</li>
</ol>
<p>Most of the students’ computational experiences are minimal prior to taking this course. They are very competent at using point-and-click software (e.g., Google Docs), but have an abundance of trouble when forced to use syntax. The precision of case-sensitivity, commas, and parentheses is outside their wheelhouse.</p>
<p>I would go so far as to say that several of these students are intimidated by the computation, and completely panic on facing an error message. This has led to us having to really think through and spend time discussing computational workflows and dealing with how to “de-bug” syntax to find errors. All of this has added more time than we anticipated on the actual computing. (While this may add time, it is still educationally useful for these students.)</p>
<p>The teaching team meets weekly for 90 minutes to discuss and reflect on what happened in the course. We also plan what will happen in the upcoming week based on what we observed and what we see in students’ homework. As of now, we clearly see that students need more practice, and we have begun giving students the end result of a plot and asking them to re-create these.</p>
<p>I am still hoping to get to scatterplots and maps in the course. However, some of the other computational ideas (scraping, joining) may have to be relegated to conceptual ideas in a reading. We are also considering scrapping the project, at least for this semester. At the very least, we will change it to a more structured set of plots they need to produce rather than letting them choose the data sets, etc. Live and learn. Next time we offer the course it will be better.</p>
<p><strong>*Technology note:</strong> RAWGraphs can be adapted by designing additional chart types, so in theory, if one had time, we could write our own version to be more compatible with the course. We are also considering using the <strong><a rel="nofollow" href="https://github.com/gertstulp/ggplotgui/" target="_blank">ggplotgui</a></strong> package, which is a Shiny dashboard for creating ggplot plots.</p>
<p> </p>
<p> </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="http://citizen-statistician.org/2017/10/07/data-visualization-course-for-freshmen/"> R Project – Citizen-Statistician</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/gHaeQq8h5qg" height="1"></a></div>