<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/scripting-for-data-analysis-with-r/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://martinsbioblogg.wordpress.com/2017/07/30/scripting-for-data-analysis-with-r/"> R – On unicorns and genes</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><a rel="nofollow" href="https://github.com/mrtnj/scripting_for_data_analysis" target="_blank">Course materials (GitHub)</a></p>
<p>This was a PhD course given in the spring of 2017 at Linköping University. The course was organised by the graduate school Forum scientium and was aimed at people who might be interested in using R for data analysis. The materials developed from a part of a previous PhD course from a couple of years ago, an R tutorial given as part of the Behaviour genetics Masters course, and the Wright lab computation lunches.</p>
<p>Around twenty people attended the seminars, and a couple of handfuls of people completed the homeworks. I don’t know how much one should read into the course evaluation form, but the feedback was mostly positive. Some people had previous exposure to R, and did the first homework in an hour. Others had never programmed in any language, and had a hard time getting started.</p>
<p>There is certainly scope for improvement. For example, some of the packages used could be substituted for more contemporary tools. One could say that the course is slouching towards the tidyverse. But I worry a bit about making the participants feel too boxed in. I don’t want them to feel that they’re taught a way that will solve some anticipated type of problems very neatly, but that may not generalize. Once I’ve made the switch to dplyr and tidyr (and maybe even purr … though I hesitate) fully myself, I would probably use them in teaching too. Another nice plus would be to be able to use <a rel="nofollow" href="http://r4ds.had.co.nz/" target="_blank">R for data science</a> as course literature. The readings now are scattered; maybe a monolithic book would be good.</p>
<p>I’ve tried, in every iteration, to emphasize the importance of writing scripts, even when working interactively with R. I still think I need to emphasize it even more. There is also a kind of ”do as I say, not as I do” issue, since in the seminars, I demo some things by just typing them into the console. I’ll force myself to write them into a script instead.</p>
<p>Possible alternate flavours for the course include: A longer version expanding on the same topics. I don’t think one should cram more contents in. I’d like to have actual projects where the participants can analyze, visualize and present data and simulations.</p>
<p>This is the course plan we sent out:</p>
<p>1. A crash course in R</p>
<p>Why do data analysis with a scripting language<br>
The RStudio interface<br>
Using R as a calculator<br>
Working interactively and writing code<br>
Getting help<br>
Reading and looking at data<br>
Installing useful packages<br>
A first graph with ggplot2</p>
<p>Homework for next time: The Unicorn Dataset, exercises in reading data, descriptive statistics, linear models and a few statistical graphs.</p>
<p>2. Programming for data analysis</p>
<p>Programming languages one may encounter in science<br>
Common concepts and code examples<br>
Data structures in R<br>
Vectors<br>
Data frames<br>
Functions<br>
Control flow</p>
<p>Homework for next time: The Unicorn Expression Dataset, exercises in data wrangling and more interesting graphs.</p>
<p>3. Working with moderately large data</p>
<p>Exercise followup<br>
More about functions<br>
Lists<br>
Objects<br>
Functional and imperative programming<br>
Doing things many times, loops and plyr<br>
Simulating data<br>
Working on a cluster</p>
<p>Final homework: Design analysis by simulation: pick a data analysis project that you care about; simulate data based on a model and reasonable effect size; implement the data analysis; and apply it to simulated data with and without effects to estimate power and other design characteristics. This ties together skills from all seminars.</p>
<p>Postat i:<a rel="nofollow" href="https://martinsbioblogg.wordpress.com/category/computer-stuff/" target="_blank">computer stuff</a>, <a rel="nofollow" href="https://martinsbioblogg.wordpress.com/category/data-analysis/" target="_blank">data analysis</a>, <a rel="nofollow" href="https://martinsbioblogg.wordpress.com/category/english/" target="_blank">english</a> Tagged: <a rel="nofollow" href="https://martinsbioblogg.wordpress.com/tag/ggplot2/" target="_blank">ggplot2</a>, <a rel="nofollow" href="https://martinsbioblogg.wordpress.com/tag/plyr/" target="_blank">plyr</a>, <a rel="nofollow" href="https://martinsbioblogg.wordpress.com/tag/r/" target="_blank">R</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/martinsbioblogg.wordpress.com/4941/" target="_blank"><img border="0" alt="" src="http://feeds.wordpress.com/1.0/delicious/martinsbioblogg.wordpress.com/4941/"></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/martinsbioblogg.wordpress.com/4941/" target="_blank"><img border="0" alt="" src="http://feeds.wordpress.com/1.0/facebook/martinsbioblogg.wordpress.com/4941/"></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/martinsbioblogg.wordpress.com/4941/" target="_blank"><img border="0" alt="" src="http://feeds.wordpress.com/1.0/twitter/martinsbioblogg.wordpress.com/4941/"></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/martinsbioblogg.wordpress.com/4941/" target="_blank"><img border="0" alt="" src="http://feeds.wordpress.com/1.0/stumble/martinsbioblogg.wordpress.com/4941/"></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/martinsbioblogg.wordpress.com/4941/" target="_blank"><img border="0" alt="" src="http://feeds.wordpress.com/1.0/digg/martinsbioblogg.wordpress.com/4941/"></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/martinsbioblogg.wordpress.com/4941/" target="_blank"><img border="0" alt="" src="http://feeds.wordpress.com/1.0/reddit/martinsbioblogg.wordpress.com/4941/"></a> <img border="0" alt="" src="https://i1.wp.com/pixel.wp.com/b.gif?resize=1%2C1&ssl=1" data-recalc-dims="1"></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://martinsbioblogg.wordpress.com/2017/07/30/scripting-for-data-analysis-with-r/"> R – On unicorns and genes</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/yvnIxSr1stU" height="1"></a></div>