{"id":357,"date":"2017-08-16T08:30:35","date_gmt":"2017-08-16T12:30:35","guid":{"rendered":"http:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/?p=357"},"modified":"2017-08-14T13:17:45","modified_gmt":"2017-08-14T17:17:45","slug":"keep-your-data-tidy","status":"publish","type":"post","link":"https:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/blog\/2017\/08\/16\/keep-your-data-tidy\/","title":{"rendered":"Keep your data tidy"},"content":{"rendered":"<p>If you&#8217;ve spent any time using <tt>R<\/tt>, you probably know the name <a href=\"http:\/\/hadley.nz\/\">Hadley Wickham<\/a>. He&#8217;s chief scientist at <a href=\"https:\/\/www.rstudio.com\/\">RStudio<\/a>, the author of 4 books on <tt>R<\/tt>, and the author of several indispensable <tt>R<\/tt> packages, including <tt>ggplot2<\/tt>, <tt>dplyr<\/tt>, and <tt>devtools<\/tt>. I was reminded recently that several years ago, he wrote a <em>very<\/em> useful paper for the <em>Journal of Statistical Software<\/em>, &#8220;Tidy data&#8221; (August 2014, Volume 59, Issue 10, <a href=\"https:\/\/www.jstatsoft.org\/article\/view\/v059i10\">https:\/\/www.jstatsoft.org\/article\/view\/v059i10<\/a>).<\/p>\n<p>If you are familiar with Hadley&#8217;s contributions to <tt>R<\/tt>, you won&#8217;t be surprised that tidy data has a simple, clean &#8211; tidy &#8211; set of requirements:<\/p>\n<ol>\n<li>Each variable forms a column.<\/li>\n<li>Each observation forms a row.<\/li>\n<li>Each type of observational unit forms a table.<\/li>\n<\/ol>\n<p>That sounds simple, but it requires that many of us rethink the way we structure our data, no more column headers as values, no more storing of multiple variables in one column, no more storing some variables in rows and others in columns. Fortunately, Hadley is also the author of <a href=\"https:\/\/github.com\/tidyverse\/tidyr\"><tt>tidyr<\/tt><\/a>. I haven&#8217;t used it yet, but given how bad I am at starting with tidy data, I suspect I&#8217;ll be using it a lot in the future.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;ve spent any time using R, you probably know the name Hadley Wickham. He&#8217;s chief scientist at RStudio, the author of 4 books on R, and the author of&#8230; <a class=\"read-more-button\" href=\"https:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/blog\/2017\/08\/16\/keep-your-data-tidy\/\">Read more &gt;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-357","post","type-post","status-publish","format-standard","hentry","category-statistics"],"_links":{"self":[{"href":"https:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/wp-json\/wp\/v2\/posts\/357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/wp-json\/wp\/v2\/comments?post=357"}],"version-history":[{"count":0,"href":"https:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/wp-json\/wp\/v2\/posts\/357\/revisions"}],"wp:attachment":[{"href":"https:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/wp-json\/wp\/v2\/media?parent=357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/wp-json\/wp\/v2\/categories?post=357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/wp-json\/wp\/v2\/tags?post=357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}