{"id":611,"date":"2018-05-23T08:30:58","date_gmt":"2018-05-23T12:30:58","guid":{"rendered":"http:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/?p=611"},"modified":"2018-05-19T15:20:59","modified_gmt":"2018-05-19T19:20:59","slug":"why-didnt-i-investigate-r-notebooks-sooner","status":"publish","type":"post","link":"https:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/blog\/2018\/05\/23\/why-didnt-i-investigate-r-notebooks-sooner\/","title":{"rendered":"Why didn&#8217;t I investigate R Notebooks sooner?"},"content":{"rendered":"<p>I don&#8217;t remember when I first heard about <a href=\"https:\/\/rmarkdown.rstudio.com\/r_notebooks.html\">R Notebooks<\/a>, but it was quite a while ago. I finally decided to investigate them last weekend, and <strong><em>I&#8217;m hooked<\/em><\/strong><strong>. <\/strong>I expect to be doing much of my R work in R notebooks from now on. For purposes of reproducibility, I still plan to extract R code from what are referred to as &#8220;chunks&#8221; to produce standalone R scripts that I can rerun from the R console to verify my results, but the interactive notebooks will allow me to run chunks as I&#8217;m developing new code\u00a0<strong><em>and<\/em><\/strong><strong>\u00a0<\/strong>to document what I&#8217;m doing.<\/p>\n<p>The link above will take you to documentation on R Notebooks. The only downside to them is that to use them you have to use <a href=\"https:\/\/www.rstudio.com\/\">RStudio<\/a>. That&#8217;s not a big downside, since there is a free version available, but I&#8217;m still enough of an old fogey that my fingers are used to <a href=\"https:\/\/www.gnu.org\/software\/emacs\/\">Emacs<\/a>, and Emacs is where I generally prefer to edit code. It will take me a while to develop a new workflow, but you can be sure that it will include R Notebooks.<\/p>\n<p>I produced a <a href=\"http:\/\/darwin.eeb.uconn.edu\/pages\/randomization.nb.html\">Randomization demo<\/a> very quickly once I updated my version of RStudio. I produced HTML simply by saving my notebook to disk. The <tt>.nb.html<\/tt> file was automatically produced in the same directory. All I had to do was to upload it to an appropriate directory here. If you have a recent version of RStudio that supports R Notebooks, you can download the Markdown code using the &#8220;Code&#8221; dropdown at the top right of the page. Simply open the <tt>.Rmd<\/tt> file, and RStudio will open it as a notebook. You can then execute chunks yourself to redo the simulation in any way that you care to. That&#8217;s even easier than copying and pasting the code I posted earlier.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I don&#8217;t remember when I first heard about R Notebooks, but it was quite a while ago. I finally decided to investigate them last weekend, and I&#8217;m hooked. I expect&#8230; <a class=\"read-more-button\" href=\"https:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/blog\/2018\/05\/23\/why-didnt-i-investigate-r-notebooks-sooner\/\">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-611","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\/611","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=611"}],"version-history":[{"count":3,"href":"https:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/wp-json\/wp\/v2\/posts\/611\/revisions"}],"predecessor-version":[{"id":614,"href":"https:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/wp-json\/wp\/v2\/posts\/611\/revisions\/614"}],"wp:attachment":[{"href":"https:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/wp-json\/wp\/v2\/media?parent=611"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/wp-json\/wp\/v2\/categories?post=611"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/darwin.eeb.uconn.edu\/uncommon-ground\/wp-json\/wp\/v2\/tags?post=611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}