<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Book Review on R Views</title>
    <link>https://rviews.rstudio.com/categories/book-review/</link>
    <description>Recent content in Book Review on R Views</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 17 Jun 2022 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://rviews.rstudio.com/categories/book-review/" rel="self" type="application/rss+xml" />
    
    
    
    
    <item>
      <title>Frank&#39;s R Workflow</title>
      <link>https://rviews.rstudio.com/2022/06/17/frank-s-workflow/</link>
      <pubDate>Fri, 17 Jun 2022 00:00:00 +0000</pubDate>
      
      <guid>https://rviews.rstudio.com/2022/06/17/frank-s-workflow/</guid>
      <description>
        &lt;p&gt;&lt;a href=&#34;https://www.fharrell.com/&#34;&gt;Frank Harrell&amp;rsquo;s&lt;/a&gt; new eBook, &lt;a href=&#34;http://hbiostat.org/rflow/&#34;&gt;&lt;em&gt;R Workflow&lt;/em&gt;&lt;/a&gt;, which aims to: &amp;ldquo;to foster best practices in reproducible data documentation and manipulation, statistical analysis, graphics, and reporting&amp;rdquo; is an ambitious document that is notable on multiple levels.&lt;/p&gt;

&lt;p&gt;To begin with, the workflow itself is much more than a simple progression of logical steps.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;workflow.png&#34; height = &#34;500&#34; width=&#34;100%&#34; alt=&#34;Diagram of Reproducible Research Workflow&#34;&gt;&lt;/p&gt;

&lt;p&gt;This workflow is clearly the result of a process forged through trial and error by a master statistician over many years. As the diagram indicates, the document takes a holistic viewpoint of a statistical analysis covering document preparation, data manipulation, statistical practice computational concerns, and more.&lt;/p&gt;

&lt;p&gt;Then, there is the synthesis of a wide range of content into a succinct, very readable exposition that dips in to some very deep topics. Frank&amp;rsquo;s examples are streamlined presentations of analyses and code that are both sophisticated an practical. The missing value section suggests a whole array of analyses through a careful presentation of plots, and the section on data checking introduces a level of automation beyond what is commonly done.&lt;/p&gt;

&lt;p&gt;Frank&amp;rsquo;s writing style is clear, informal and from the perspective of a teacher who wants to show you some cool things along with the basics. For example, don&amp;rsquo;t miss the &lt;em&gt;if Trick&lt;/em&gt; in section 2.4.3.&lt;/p&gt;

&lt;p&gt;I should mention that Frank&amp;rsquo;s eBook is not a &lt;em&gt;tidyverse&lt;/em&gt; presentation. The code examples are built around base R, Frank&amp;rsquo;s &lt;code&gt;Hmisc&lt;/code&gt; and &lt;code&gt;rms&lt;/code&gt; packages and an eclectic mix of  packages that include &lt;code&gt;data.table&lt;/code&gt;. &lt;code&gt;plotly&lt;/code&gt; and &lt;em&gt;tidyverse&lt;/em&gt; packages &lt;code&gt;haven&lt;/code&gt; and  &lt;code&gt;ggplot2&lt;/code&gt;. In a way, this selection of packages reflects the evolution of R itself.  For example, as with many popular R packages,  &lt;code&gt;Hmisc&lt;/code&gt; most likely started out as Frank&amp;rsquo;s personal tool kit. However, after many years of Frank&amp;rsquo;s deep commitment to using R and contributing R tools, which includes seventy versions of &lt;code&gt;Hmisc&lt;/code&gt; in nineteen years, the package has become a fundamental resource. (Have a look at the reverse depends, imports, and suggests.) Also, the mix of packages with different design philosophies underlying &lt;em&gt;R Workflow&lt;/em&gt; reflects the flexibility of the R language and the organic growth of the R ecosystem.&lt;/p&gt;

&lt;p&gt;Perhaps the most striking aspect of the eBook is the way Frank uses &lt;a href=&#34;https://quarto.org/&#34;&gt;&lt;code&gt;Quarto&lt;/code&gt;&lt;/a&gt;, &lt;code&gt;knitr&lt;/code&gt; and &lt;code&gt;Hmisc&lt;/code&gt; to build an elegant reproducible document about building reproducible documents. For example, &lt;code&gt;Quarto&lt;/code&gt; permits the effective placement of plots in the right margins of the document, and the &lt;code&gt;Quarto&lt;/code&gt; &lt;em&gt;callouts&lt;/em&gt; in Section 3.4 enable the mini tutorials that include &lt;em&gt;Special Considerations for Latex/pdf&lt;/em&gt; and &lt;em&gt;Using Tooltips with Mermaid&lt;/em&gt; to be embedded in the document without interrupting its flow. Moreover, along with functions like &lt;code&gt;Hmisc::getHdata()&lt;/code&gt; and &lt;code&gt;Hmisc::getRs()&lt;/code&gt;, &lt;code&gt;Quarto&lt;/code&gt; enables the document to achieve a high level of reproducibility by pulling data and code directly from GitHub repositories.&lt;/p&gt;

&lt;p&gt;Not only can Frank&amp;rsquo;s &lt;em&gt;R Workflow&lt;/em&gt; teach you some serious statistics, but studying its construction will take you a long way towards building aesthetically pleasing reproducible documents.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Frank Harrell will be delivering a keynote address on August 26th at the upcoming &lt;a href=&#34;https://events.linuxfoundation.org/r-medicine/&#34;&gt;R/Medicine&lt;/a&gt; conference.&lt;/em&gt;&lt;/p&gt;

        &lt;script&gt;window.location.href=&#39;https://rviews.rstudio.com/2022/06/17/frank-s-workflow/&#39;;&lt;/script&gt;
      </description>
    </item>
    
    <item>
      <title>A Few Old Books</title>
      <link>https://rviews.rstudio.com/2019/04/25/a-few-old-books/</link>
      <pubDate>Thu, 25 Apr 2019 00:00:00 +0000</pubDate>
      
      <guid>https://rviews.rstudio.com/2019/04/25/a-few-old-books/</guid>
      <description>
        &lt;p&gt;&lt;em&gt;Greg Wilson is a data scientist and professional educator at RStudio.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;My &lt;a href=&#34;https://rviews.rstudio.com/2019/02/20/a-few-new-books/&#34;&gt;previous column&lt;/a&gt; looked at a few new books about R. In this one, I&amp;rsquo;d like to explore a few books about programming that people coming from data science backgrounds may not have stumbled upon.&lt;/p&gt;

&lt;p&gt;The first is Michael Nygard&amp;rsquo;s &lt;a href=&#34;https://pragprog.com/book/mnee2/release-it-second-edition&#34;&gt;&lt;em&gt;Release It!&lt;/em&gt;&lt;/a&gt;, which more than lives up to its subtitle, &amp;ldquo;Design and Deploy Production-Ready Software&amp;rdquo;.  Most of us can write programs that work for us on our machines; this book explores what it takes to create software that will work reliably for other people, on machines you&amp;rsquo;ve never met, long after you&amp;rsquo;ve moved on to your next project.  It focuses on software that&amp;rsquo;s deployed for general use rather than installed on individuals&amp;rsquo; machines, and covers stability patterns and anti-patterns, designing software to meet production needs, security, and a range of other pragmatic issues.  You might not need to take care of these things yourself, but whoever has to get your software running on the departmental cluster will be grateful that you thought about it, and can have a sensible conversation about trade-offs.&lt;/p&gt;

&lt;p&gt;The second book is Andreas Zeller&amp;rsquo;s &lt;a href=&#34;http://www.whyprogramsfail.com/&#34;&gt;&lt;em&gt;Why Programs Fail&lt;/em&gt;&lt;/a&gt;, which bills itself as &amp;ldquo;a guide to pragmatic debugging&amp;rdquo;, and has been turned into &lt;a href=&#34;https://www.udacity.com/course/software-debugging--cs259&#34;&gt;a Udacity course&lt;/a&gt;.  Programmers spend anywhere from a quarter to three quarters of their time debugging, but most only get an in-passing overview of how to do this well, and are never shown tools more advanced than print statements and break-point debuggers.  Zeller starts with that, but goes much further to look at automatic and semi-automatic ways of simplifying programs to localize problems, isolating values&amp;rsquo; origins, program slicing, anomaly detection, and much more.  Some of the methods he describes will seem very familiar to data scientists, though the domain is new; others will take readers without a computer-science background into new territory in the same way that &lt;a href=&#34;https://adv-r.hadley.nz/&#34;&gt;&lt;em&gt;Advanced R&lt;/em&gt;&lt;/a&gt; does.&lt;/p&gt;

&lt;p&gt;Our third entry is Michael Feathers&amp;rsquo; &lt;a href=&#34;https://www.oreilly.com/library/view/working-effectively-with/0131177052/&#34;&gt;&lt;em&gt;Working Effectively with Legacy Code&lt;/em&gt;&lt;/a&gt;. Feathers defines legacy code as software that we&amp;rsquo;re reluctant to modify because we don&amp;rsquo;t understand how it works and are afraid of breaking.  Having a comprehensive test suite allays this fear, but how can we construct one after the fact for a tangled mess of code?  The bulk of the book explores answers to this question, including how to identify seams where code can be split, how to break dependencies so that parts can be improved incrementally, and so on.  Some of the examples may seem a little out of date (the book is almost 15 years old), but they all apply directly to the unholy mixture of Perl, shell scripts, hundred-line SQL statements, and ten-page R scripts that you were just handed.&lt;/p&gt;

&lt;p&gt;Number four is Jeff Johnson&amp;rsquo;s &lt;a href=&#34;https://www.elsevier.com/books/gui-bloopers-20/johnson/978-0-12-370643-0&#34;&gt;&lt;em&gt;GUI Bloopers&lt;/em&gt;&lt;/a&gt;.  I was in two startups in the 1990s, and in both of them, I was told after a few weeks that I was never allowed to work on the user interface again.  It was the right decision, but this book might have made it unnecessary.  Rather than trying to explain the rules for designing a good user interface, Johnson gives example after example of how to fix bad ones.  The companion book, &lt;a href=&#34;https://textbooks.elsevier.com/manualsprotectedtextbooks/9781558608405/Static/index.html&#34;&gt;&lt;em&gt;Web Bloopers&lt;/em&gt;&lt;/a&gt;, is less useful today because web interfaces have evolved so rapidly, but either will help you make an interface that is at least not bad.&lt;/p&gt;

&lt;p&gt;The last entry for this post is Ashley Davis&amp;rsquo;s &lt;a href=&#34;https://www.manning.com/books/data-wrangling-with-javascript&#34;&gt;&lt;em&gt;Data Wrangling with JavaScript&lt;/em&gt;&lt;/a&gt;. As its title suggests, it doesn&amp;rsquo;t spend very much time on statistical theory; instead, it covers the &amp;ldquo;other 90%&amp;rdquo; of squeezing answers out of data, from establishing your data pipeline and getting started with Node (a widely-used command-line version of JavaScript) to cleaning, analyzing, and visualizing data. There are lots of code samples and plenty of diagrams, and you can download both the data sets the author uses in examples and his &lt;a href=&#34;http://www.data-forge-js.com/&#34;&gt;Data-Forge library&lt;/a&gt;. I suspect readers will need some prior familiarity with JavaScript to dive into this, but Davis shows just how far you can go with what&amp;rsquo;s available today, and that the journey is a lot smoother than people might think.&lt;/p&gt;

        &lt;script&gt;window.location.href=&#39;https://rviews.rstudio.com/2019/04/25/a-few-old-books/&#39;;&lt;/script&gt;
      </description>
    </item>
    
    <item>
      <title>Paid in Books: An Interview with Christian Westergaard</title>
      <link>https://rviews.rstudio.com/2019/03/07/treasured-books-an-interview-with-christian-westergaard/</link>
      <pubDate>Thu, 07 Mar 2019 00:00:00 +0000</pubDate>
      
      <guid>https://rviews.rstudio.com/2019/03/07/treasured-books-an-interview-with-christian-westergaard/</guid>
      <description>
        &lt;p&gt;R is greatly benefiting from new users coming from disciplines that traditionally did not provoke much serious computation. Journalists&lt;sup&gt;1&lt;/sup&gt; and humanist scholars&lt;sup&gt;2&lt;/sup&gt;, for example, are embracing R. But, does the avenue from the Humanities go both ways? In a recent conversation with Christian Westergaard, proprietor of &lt;a href=&#34;https://www.sophiararebooks.com/&#34;&gt;Sophia Rare Books&lt;/a&gt; in Copenhagen, I was delighted to learn that it does.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;em&gt;JBR: I was very pleased to learn when I spoke with you recently at the California Antiquarian Book Fair that you were an S and S+ user in graduate school. What were you studying and how how was S and S+ helpful?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;CW: I did a Master&amp;rsquo;s in mathematics and a Bachelor&amp;rsquo;s in statistics at the University of Copenhagen in Denmark, graduating in 2005. During the first year of my courses in statistics, we were quickly introduced to S+ in order to do monthly assignments. In these assignments, we were to apply the theory we had learned in the lectures on some concrete data. I still remember how difficult I initially found applying the right statistical tools to real-world problems, rather than just understanding the math in theoretical statistics. I developed a deep respect for applied statistics. Our minds can easily be deceived and we need proper statistics to make the right decisions.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;JBR: How did you move from technical studies to dealing in rare scientific books and manuscripts? On the surface it seems that these might be two completely unrelated activities. How did you find a path between these two worlds?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;CW: It was a gradual shift. When I first began studying, I went into an old antiquarian book shop to acquire some second-hand math and statistic books to supplement my ordinary course texts. One of them was Statistical Methods by &lt;a href=&#34;https://en.wikipedia.org/wiki/Anders_Hald&#34;&gt;Anders Hald&lt;/a&gt;. Hald was no longer working at the university, but his text had become a classic. I was fascinated by this book shop. The owner was an old, grey-haired man sitting behind a huge stack of books smoking a pipe, and writing his sales catalogues on an old IBM typing machine. He allowed me to go down into his cellar where there books everywhere from floor to ceiling. There were many books which I wanted to acquire down there, but I hardly had any money. It was a mess in the cellar and I offered to tidy up if he could pay me in the books I wanted, and he agreed. I loved coming to work there, and I continued to do so my entire studies. My boss gave me more and more responsibility and put me in charge of the mathematics, physics, statistics and science books in general. When I finished my masters, I was considering doing a PhD. I loved mathematics and still do until this day. But I also found that when I woke up in the morning, I was thinking of antiquarian books and in the evening I couldn’t get to bed because I was thinking of books. It gave me energy and happiness. So I thought, why not try and be a rare book dealer for a year or two and see how it works out? It’s been 14 years since I made that decision, and I have really enjoyed it. In 2009, I decided to start my own company and specialize in important books and manuscripts in science.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;JBR: What is it like to be immersed in these rare artifacts that were so important for the transmission of scientific knowledge? What kinds of scholars do you consult to establish the authenticity of works like Euler’s &lt;a href=&#34;https://www.sophiararebooks.com/pages/books/4420/leonhard-euler/opuscula-varii-argumenti-tomus-i-conjectura-physica-circa-propagationem-soni-ac-luminis-tomus-ii&#34;&gt;Opuscula Varii Argumenti&lt;/a&gt; or Cauchy’s &lt;a href=&#34;https://www.sophiararebooks.com/pages/books/3696/augustin-louis-cauchy/lecons-sur-le-calcul-diff-rentiel&#34;&gt;Leçons sur le calcul diffrentiel&lt;/a&gt;?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/post/2019-03-05-Sophia_files/Cauchy.png&#34; height = &#34;200&#34; width=&#34;400&#34;&gt;&lt;/p&gt;

&lt;p&gt;CW: I feel privileged to handle some of these objects on a daily basis. One day I am sitting with an original autograph manuscript by Einstein doing research on relativity, and the next day I have  a presentation copy of Darwin’s Origin of Species in my hands. These are objects which have changed the world and the way we think about ourselves. In addition to the books and manuscripts, I find the people who I meet extremely interesting. A few years before Anders Hald (whose book had originally brought me into my old boss’ shop) passed away, I went to buy his books. He was 92 and completely fresh in his mind. We spoke about the history of statistics – a subject about which he authored several books.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;JBR: I have noticed that collectors seem to be very interested in the works of twentieth-century mathematicians and physicists. You have works by &lt;a href=&#34;https://www.sophiararebooks.com/pages/books/4543/alonzo-church/an-unsolvable-problem-in-elementary-number-theory&#34;&gt;Alonzo Church&lt;/a&gt;, &lt;a href=&#34;https://www.sophiararebooks.com/pages/books/4559/kurt-godel/uber-formal-unentscheidbare-satze-der-principia-mathematica-undver-wandter-systeme-i-offprint&#34;&gt;Kurt Gödel&lt;/a&gt;, &lt;a href=&#34;https://www.sophiararebooks.com/pages/books/4459/richard-phillips-feynman/surely-you-re-joking-mr-feynman-adventures-of-a-curious-character-as-told-to-ralph-leighton&#34;&gt;Richard Feynman&lt;/a&gt;, and others in your catalogue. But your roster of statisticians seems to focus on the old masters such as &lt;a href=&#34;https://www.sophiararebooks.com/pages/books/4159/pierre-simon-laplace-marquis-de/theorie-analytique-des-probabilites-paris-courcier-1812-with-supplement-a-la-theorie-analytique&#34;&gt;Laplace&lt;/a&gt; and &lt;a href=&#34;https://www.sophiararebooks.com/pages/books/4637/abraham-de-moivre/the-doctrine-of-chances-or-a-method-of-calculating-the-probability-of-events-in-play&#34;&gt;de Moivre&lt;/a&gt;. Are collectors also interested in Karl Pearson, Udny Yule, and R. A. Fisher?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/post/2019-03-05-Sophia_files/deMoivre.png&#34; height = &#34;200&#34; width=&#34;400&#34;&gt;&lt;/p&gt;

&lt;p&gt;CW: Certainly. Maybe so much so that every time I get one of Pearson or Fisher’s main papers they sell immediately. That’s why you don’t see them in my stock at the moment.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;JBR: I noticed that you had two works by &lt;a href=&#34;https://www.sophiararebooks.com/pages/books/4276/sonya-kowalevsky-sofya-vasilyevna-or-kovalevskaya/sur-une-propriete-du-systeme-dequations-differentielles-qui-definit-la-rotation-dun-corps-solide&#34;&gt;Sofya Vasilyevna Kovalevskaya&lt;/a&gt; on display in California. Do you see a renewed interest in the works of women scientists and mathematicians, or is this remarkable and brilliant woman an exception?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;CW: There has definitely been a renewed interest in exceptional woman scientists. A few years ago the New York-based Grolier Club hosted an exhibition called ‘Extraordinary Women in Science and Medicine’, and several institutions are focusing on the subject. These woman who broke through the social constraints against them are exceptional and fascinating people.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;JBR: Although there are notable exceptions (Donald Knuth’s typesetting comes to mind), I think most data scientists, computer scientists, and statisticians work in a digital world of ebooks and poorly printed texts. Do you think that the technical book as a collectable artifact will survive the twenty-first century? What advice would you give to working data scientists and statisticians who are interested in collecting?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;CW: Good question. Many important papers nowadays are not even printed, and the only physical material a researcher might have left from some landmark work might be some scribbles he or she did on a piece of paper. There are examples of people who collect digital art. They use various ways of signing or otherwise authenticating the artists work even if it’s on a USB stick. Maybe that’s how some research papers might be collected in the future?&lt;/p&gt;

&lt;p&gt;My advice for anyone wanting to start collecting would be to first focus on some of the classics in their field or some other field that fascinates them. The classics will have been collected by many others in the past and there will be good descriptions, bibliographies, and catalogues describing them and why they are collectible. That way one will gradually get a feeling about which mechanisms are important when collecting and what to focus on, e.g., condition, provenance, etc. And then I’d say it’s important to build a good relationship with at least one dealer with a good reputation in the trade. Any great collection is built on a collaboration were collectors and dealers work together.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;JBR: Excellent advice! Thank you Christian.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; For example, have a look at some of the R training at this year&amp;rsquo;s &lt;a href=&#34;https://www.ire.org/conferences/nicar-2019/&#34;&gt;IRE-CAR Conference&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;sup&gt;2&lt;/sup&gt; See, for example, these University of Washington &lt;a href=&#34;https://libguides.wustl.edu/c.php?g=385216&amp;amp;p=3561786&#34;&gt;resources&lt;/a&gt; for the digital humanities.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href=&#34;https://www.sophiararebooks.com/&#34;&gt;Sophia Rare Books&lt;/a&gt; (Copenhagen), specializes in rare and important books and manuscripts in the History of Science and Medicine fields.&lt;/em&gt;&lt;/p&gt;

        &lt;script&gt;window.location.href=&#39;https://rviews.rstudio.com/2019/03/07/treasured-books-an-interview-with-christian-westergaard/&#39;;&lt;/script&gt;
      </description>
    </item>
    
    <item>
      <title>A Few New R Books</title>
      <link>https://rviews.rstudio.com/2019/02/20/a-few-new-books/</link>
      <pubDate>Wed, 20 Feb 2019 00:00:00 +0000</pubDate>
      
      <guid>https://rviews.rstudio.com/2019/02/20/a-few-new-books/</guid>
      <description>
        &lt;p&gt;&lt;em&gt;Greg Wilson is a data scientist and professional educator at RStudio.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;As a newcomer to R who prefers to read paper rather than pixels, I&amp;rsquo;ve been working my way through a more-or-less random selection of relevant books over the past few months. Some have discussed topics that I&amp;rsquo;m already familiar with in the context of R, while others have introduced me to entirely new subjects. This post describes four of them in brief; I hope to follow up with a second post in a few months as I work through the backlog on my desk.&lt;/p&gt;

&lt;p&gt;First up is Sharon Machlis&amp;rsquo; &lt;a href=&#34;https://www.amazon.ca/dp/1138726915/&#34;&gt;&lt;em&gt;Practical R for Mass Communcation and Journalism&lt;/em&gt;&lt;/a&gt;, which is based on the author&amp;rsquo;s workshops for journalists. This book dives straight into doing the kinds of things a busy reporter or news analyst needs to do to meet a 5:00 pm deadline: data cleaning, presentation-quality graphics, and maps take precedence over control flow or the niceties of variable scope. I particularly enjoyed the way each chapter starts with a realistic project and works through what&amp;rsquo;s needed to build it. People who&amp;rsquo;ve never programmed before will be a little intimidated by how many packages they need to download if they try to work through the material on their own, but the instructions are clear, and the author&amp;rsquo;s enthusiasm for her material shines through in every example. (If anyone is working on a similar tutorial for sports data, please let me know - I have more than a few friends it would make very happy.)&lt;/p&gt;

&lt;p&gt;In contrast, Chris Beeley and Shitalkumar Sukhdeve&amp;rsquo;s &lt;a href=&#34;https://www.amazon.ca/Web-Application-Development-Using-Shiny/dp/1788993128/&#34;&gt;&lt;em&gt;Web Application Development with R Using Shiny&lt;/em&gt;&lt;/a&gt; focuses on a particular tool rather than a industry vertical. It covers exactly what its title promises, step by step from the basics through custom JavaScript functions and animations through persistent storage. Every example I ran was cleanly written and clearly explained, and it&amp;rsquo;s clear that the authors have tested their material with real audiences. I particularly appreciated the chapter on code patterns - while I&amp;rsquo;m still not sure I fully understand when and how to use &lt;code&gt;isolate()&lt;/code&gt; and &lt;code&gt;req()&lt;/code&gt;, I&amp;rsquo;m much less confused than I was.&lt;/p&gt;

&lt;p&gt;Functional programming has been the next big thing in computing since I was a graduate student in the 1980s. It does finally seem to be getting some traction outside the craft-beer-and-Emacs community, and &lt;a href=&#34;https://www.amazon.ca/dp/148422745X/&#34;&gt;&lt;em&gt;Functional Programming in R&lt;/em&gt;&lt;/a&gt; by Thomas Mailund looks at how these ideas can be used in R. Mailund writes clearly, and readers who don&amp;rsquo;t have a background in computer science may find this a gentle way into a complex subject. However, despite the subtitle &amp;ldquo;Advanced Statistical Programming for Data Science, Analysis and Finance&amp;rdquo;, there&amp;rsquo;s nothing particularly statistical or financial about the book&amp;rsquo;s content. Some parts felt rushed, such as the lightning coverage of point-free programming (which should have had either a detailed exposition or no mention at all), but my biggest complaint about the book is its price: I think $34 for 100 pages is more than most people will want to pay.&lt;/p&gt;

&lt;p&gt;Finally, we have Stefano Allesina and Madlen Wilmes&amp;rsquo; &lt;a href=&#34;https://www.amazon.ca/dp/0691182752/&#34;&gt;&lt;em&gt;Computing Skills for Biologists&lt;/em&gt;&lt;/a&gt;. As the subtitle says, this book presents a toolbox that includes Python, Git, LaTeX, and SQL as well as R, and is aimed at graduate students in biology who have just realized that a few hundred megabytes of messy data are standing between them and their thesis. The authors present the basics of each subject clearly and concisely using real-world data analysis examples at every turn. They freely admit in the introduction that coverage will be broad and shallow, but that&amp;rsquo;s exactly what books like this should aim for, and they hit a bulls eye. The book&amp;rsquo;s only weakness - unfortunately, a significant one - is an almost complete lack of diagrams. There are only six figures in its 400 pages, and none in the material on visualization. I realize that readers who are coding along with the examples will be able to view some plots and charts as they go, but I would urge the authors to include these in a second edition.&lt;/p&gt;

&lt;p&gt;R is growing by leaps and bounds, and so is the literature about it. If you have written or read a book on R recently that you think others would be interested in, please &lt;a href=&#34;mailto:greg.wilson@rstudio.com&#34;&gt;let us know&lt;/a&gt; - we&amp;rsquo;d enjoy checking it out.&lt;/p&gt;

&lt;p&gt;Stefano Allesina and Madlen Wilmes: &lt;em&gt;&lt;a href=&#34;https://www.amazon.ca/dp/0691182752/&#34;&gt;Computing Skills for Biologists: A Toolbox&lt;/a&gt;&lt;/em&gt;. Princeton University Press, 978-0691182759.&lt;/p&gt;

&lt;p&gt;Chris Beeley and Shitalkumar Sukhdeve: &lt;em&gt;&lt;a href=&#34;https://www.amazon.ca/Web-Application-Development-Using-Shiny/dp/1788993128/&#34;&gt;Web Application Development with R Using Shiny&lt;/a&gt;&lt;/em&gt; (3rd ed.). Packt, 2018, 978-1788993128.&lt;/p&gt;

&lt;p&gt;Sharon Machlis: &lt;em&gt;&lt;a href=&#34;https://www.amazon.ca/dp/1138726915/&#34;&gt;Practical R for Mass Communcation and Journalism&lt;/a&gt;&lt;/em&gt;. Chapman &amp;amp; Hall/CRC, 2018, 978-1138726918.&lt;/p&gt;

&lt;p&gt;Thomas Mailund: &lt;em&gt;&lt;a href=&#34;https://www.amazon.ca/dp/148422745X/&#34;&gt;Functional Programming in R: Advanced Statistical Programming for Data Science, Analysis and Finance&lt;/a&gt;&lt;/em&gt;. Apress, 2017, 978-1484227459.&lt;/p&gt;

        &lt;script&gt;window.location.href=&#39;https://rviews.rstudio.com/2019/02/20/a-few-new-books/&#39;;&lt;/script&gt;
      </description>
    </item>
    
    <item>
      <title>Review of Efficient R Programming</title>
      <link>https://rviews.rstudio.com/2017/05/19/efficient_r_programming/</link>
      <pubDate>Fri, 19 May 2017 00:00:00 +0000</pubDate>
      
      <guid>https://rviews.rstudio.com/2017/05/19/efficient_r_programming/</guid>
      <description>
        
&lt;!-- BLOGDOWN-HEAD --&gt;
&lt;!-- /BLOGDOWN-HEAD --&gt;

&lt;!-- BLOGDOWN-BODY-BEFORE --&gt;
&lt;!-- /BLOGDOWN-BODY-BEFORE --&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2017-05-15_Efficient_R_Programming_files/cover.PNG&#34; /&gt;

&lt;/div&gt;
&lt;p&gt;In the crowded market space of data science and R language books, Lovelace and Gillespie’s &lt;a href=&#34;http://shop.oreilly.com/product/0636920047995.do&#34;&gt;Efficient R Programming&lt;/a&gt; (2016) stands out from the crowd. Over the course of ten comprehensive chapters, the authors address the primary tenets of developing efficient R programs. Unless you happen to be a member of the R core development team, you will find this book useful whether you are a novice R programmer or an established data scientist and engineer. This book is chock full of useful tips and techniques that will help you improve the efficiency of your R programs, as well as the efficiency of your development processes. Although I have been using R daily (and nearly exclusively) for the past 4+ years, every chapter of this book provided me with new insights into how to improve my R code while helping solidify my understanding of previously learned techniques. Each chapter of &lt;strong&gt;Efficient R Programming&lt;/strong&gt; is devoted to a single topic, each of which includes a “top five tips” list, covers numerous packages and techniques, and contains useful exercises and problem sets for consolidating key insights.&lt;/p&gt;
&lt;p&gt;In &lt;strong&gt;Chapter 1. Introduction&lt;/strong&gt;, the authors orient the audience to the key characteristics of R that affect its efficiency, compared to other programming languages. Importantly, the authors address R efficiency not just in the expected sense of algorithmic speed and complexity, but broaden its scope to include programmer productivity and how it relates to programming idioms, IDEs, coding conventions, and community support – all things that can improve the efficiency of writing and maintaining code. This is doubly important for a language like R, which is notoriously flexible in its ability to solve problems in multiple ways. The first chapter concludes by introducing the reader to two valuable packages: (1) &lt;a href=&#34;https://cran.r-project.org/web/packages/microbenchmark/microbenchmark.pdf&#34;&gt;microbenchmark&lt;/a&gt;, an accurate benchmarking tool with nanosecond precision; and (2) &lt;a href=&#34;https://cran.r-project.org/web/packages/profvis/profvis.pdf&#34;&gt;profvis&lt;/a&gt;, a handy tool for profiling larger chunks of code. These two packages are repeatedly used throughout the remainder of the book to illustrate key concepts and highlight efficient techniques.&lt;/p&gt;
&lt;p&gt;In &lt;strong&gt;Chapter 2. Efficient Setup&lt;/strong&gt;, the reader is introduced to techniques for setting up a development environment that facilitates efficient workflow. Here the authors cover choices in operating system, R version, R start-up, alternative R interpreters, and how to maintain up-to-date packages with tools like &lt;a href=&#34;https://cran.r-project.org/web/packages/packrat/packrat.pdf&#34;&gt;packrat&lt;/a&gt; and &lt;a href=&#34;https://cran.r-project.org/web/packages/installr/installr.pdf&#34;&gt;installr&lt;/a&gt;. I found their overview of the R startup process particularly useful, as the authors taught me how to modify my &lt;strong&gt;.Renviron&lt;/strong&gt; and &lt;strong&gt;.Rprofile&lt;/strong&gt; files to cache external API keys and customize my R environment, for example by adding alias shortcuts to commonly used functions. The chapter concludes by discussing how to setup and customize the &lt;a href=&#34;https://www.rstudio.com/&#34;&gt;RStudio&lt;/a&gt; environment (e.g., modifying code editing preference, editing keyboard shortcuts, and turning off restore &lt;strong&gt;.Rdata&lt;/strong&gt; to help prevent bugs), which can greatly improve individual efficiency.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Chapter 3. Efficient Programming&lt;/strong&gt; introduces the reader to efficient programming by discussing “big picture” programming techniques and how they relate to the R language. This chapter will most likely be beneficial to established programmers who are new to R, as well as to data scientists and analysts who have limited exposure to programming in a production environment. In this chapter the authors introduce the “golden rule of R programming” before delving into the usual suspects of inefficient R code. Usefully, the book illustrates multiple ways of performing the same task (e.g., data selection) with different code snippets, and highlights the performance differences through benchmarked results. Here we learn about the pitfalls of growing vectors, the benefits of vectorization, and the proper use of factors. The chapter wraps up with the requisite overview of the apply function family, before discussing the use of variable caching (package &lt;a href=&#34;https://cran.r-project.org/web/packages/memoise/memoise.pdf&#34;&gt;memoise&lt;/a&gt;) and byte compilation as important techniques in writing fast, responsive R code.&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2017-05-15_Efficient_R_Programming_files/byte.PNG&#34; /&gt;

&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Chapter 4. Efficient Workflow&lt;/strong&gt; will be of primary use to junior-level programmers, analysts, and project managers who haven’t had enough time or practice to develop their own efficient workflows. This chapter discusses the importance of project planning, audience, and scope before delving into common tools that facilitate project management. In my opinion, one of best aspects of R is the huge, maddeningly broad number of packages that are available on &lt;a href=&#34;https://cran.r-project.org/&#34;&gt;CRAN&lt;/a&gt; and &lt;a href=&#34;https://github.com/&#34;&gt;GitHub&lt;/a&gt;. The authors provide useful advice and techniques for identifying the packages that will be of most use to your project. A brief discussion on the use of R Markdown and knitr concludes this chapter.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Chapter 5. Efficient Input/Output&lt;/strong&gt; is devoted to efficient read/write operations. Anybody who has ever struggled with loading a big file into R for analysis will appreciate this discussion and the packages covered in this chapter. The &lt;a href=&#34;https://cran.r-project.org/web/packages/rio/rio.pdf&#34;&gt;rio&lt;/a&gt; package, which can handle a wide variety of common data file types, provides a useful starting point for exploratory work on a new project. Other packages that are discussed (including &lt;a href=&#34;https://cran.r-project.org/web/packages/readr/readr.pdf&#34;&gt;readr&lt;/a&gt; and &lt;a href=&#34;https://cran.r-project.org/web/packages/data.table/data.table.pdf&#34;&gt;data.table&lt;/a&gt;) provide more efficient I/O than those in base R. The chapter ends with a discussion of two new file formats and associated packages, (&lt;a href=&#34;https://cran.r-project.org/web/packages/feather/feather.pdf&#34;&gt;feather&lt;/a&gt; and &lt;a href=&#34;https://cran.r-project.org/web/packages/RProtoBuf/RProtoBuf.pdf&#34;&gt;RProtoBuf&lt;/a&gt;), that can be used for cross-language, fast, efficient serialized data I/O.&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2017-05-15_Efficient_R_Programming_files/feather.PNG&#34; /&gt;

&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Chapter 6. Efficient Data Carpentry&lt;/strong&gt; introduces what are, in my opinion, the most useful R tools for &lt;em&gt;data munging&lt;/em&gt; – what Lovelace and Gillespie prefer to call by the more admirable term “data carpentry.” This chapter could more aptly be titled the “Tidyverse” or the “Hadleyverse”, for most of the tools discussed in this chapter were developed by prolific R package writer, &lt;a href=&#34;https://github.com/hadley&#34;&gt;Hadley Wickham&lt;/a&gt;. Sections of the chapter are devoted to each of the primary packages of the &lt;a href=&#34;https://github.com/tidyverse&#34;&gt;tidyverse&lt;/a&gt;: &lt;a href=&#34;https://cran.r-project.org/web/packages/tibble/tibble.pdf&#34;&gt;tibble&lt;/a&gt;, a more useful and user-friendly data.frame; &lt;a href=&#34;https://cran.r-project.org/web/packages/tidyr/tidyr.pdf&#34;&gt;tidyr&lt;/a&gt;, used for reshaping data between short and long forms; &lt;a href=&#34;https://cran.r-project.org/web/packages/stringr/stringr.pdf&#34;&gt;stringr&lt;/a&gt;, which provides a consistent API over obtuse regex functions; &lt;a href=&#34;https://cran.r-project.org/web/packages/dplyr/dplyr.pdf&#34;&gt;dplyr&lt;/a&gt;, used for efficient data processing including filtering, sorting, mutating, joining, and summarizing; and of course &lt;a href=&#34;https://cran.r-project.org/web/packages/magrittr/magrittr.pdf&#34;&gt;magrittr&lt;/a&gt;, for piping all these operations together with &lt;code&gt;%&amp;gt;%&lt;/code&gt;. A brief section on package &lt;a href=&#34;https://cran.r-project.org/web/packages/data.table/data.table.pdf&#34;&gt;data.table&lt;/a&gt; rounds out the discussion on efficient data carpentry.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Chapter 7. Efficient Optimization&lt;/strong&gt; begins with the requisite optimization quote by computer scientist Donald Knuth:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The real problem is that programmers have spent far too much time worrying about efficiency in the wrong places and at the wrong times; premature optimization is the root of all evil (or at least most of it) in programming.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In this chapter, the authors introduce &lt;a href=&#34;https://cran.r-project.org/web/packages/profvis/profvis.pdf&#34;&gt;profvis&lt;/a&gt;, and they illustrate the utility of this package by showing how it can be used to identify bottlenecks in a Monte Carlo simulation of a Monopoly game. The authors next examine alternative methods in base R that can be used for greater efficiency. These include discussion of &lt;code&gt;if()&lt;/code&gt; vs. &lt;code&gt;ifelse()&lt;/code&gt;, sorting operations, AND (&lt;code&gt;&amp;amp;&lt;/code&gt;) and OR (&lt;code&gt;|&lt;/code&gt;) vs. &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; and &lt;code&gt;||&lt;/code&gt;, row/column operations, and sparse matrices. The authors then apply these tricks to the Monopoly code to show a 20-fold decrease in run time. The chapter concludes with a discussion and examples of parallelization, and the use of &lt;a href=&#34;https://cran.r-project.org/web/packages/Rcpp/Rcpp.pdf&#34;&gt;Rcpp&lt;/a&gt; as an R interface to underlying fast and efficient C++ code.&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2017-05-15_Efficient_R_Programming_files/profvis.PNG&#34; /&gt;

&lt;/div&gt;
&lt;p&gt;I found the chapter &lt;strong&gt;Efficient Hardware&lt;/strong&gt; to be the least useful in the book (spoiler alert: add more RAM or migrate to cloud-based services), though the chapter on &lt;strong&gt;Efficient Collaboration&lt;/strong&gt; will be particularly useful for novice data scientists lacking real-world experience developing data artifacts and production applications in a distributed, collaborative environment. In this chapter, the authors discuss the importance of coding style, code comments, version control, and code review. The final chapter &lt;strong&gt;Efficient Learning&lt;/strong&gt;, will find appreciative readers among those just getting started with R (and if this describes you, I would suggest that you start with this chapter first!). Here the authors discuss using and navigating R’s excellent internal help utility, as well as the importance of vignettes and source code in learning/understanding. After briefly introducing &lt;a href=&#34;https://cran.r-project.org/web/packages/swirl/swirl.pdf&#34;&gt;swirl&lt;/a&gt;, the book concludes with a discussion of online resources, including &lt;a href=&#34;http://stackoverflow.com/&#34;&gt;Stack Overflow&lt;/a&gt;; the authors thankfully provide the newbie with important information on how to ask the right questions and the importance of providing a &lt;a href=&#34;http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example&#34;&gt;great R reproducible example&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In summary, Lovelace and Gillespie’s &lt;strong&gt;Efficient R Programming&lt;/strong&gt; does an admirable job of illustrating the key techniques and packages for writing efficient R programs. The book will appeal to a wide audience from advanced R programmers to those just starting out. In my opinion, the book hits that pragmatic sweet spot between breadth and depth, and it usefully contains links to external resources for those wishing to delve deeper into a specific topic. After reading this book, I immediately went to work refactoring a &lt;a href=&#34;https://shiny.rstudio.com/&#34;&gt;Shiny&lt;/a&gt; dashboard application I am developing and several internal R packages I maintain for our data science team. In a matter of a few short hours, I witnessed a 5 to 10-fold performance increase in these applications just by implementing a couple of new techniques. I was particularly impressed with the greatly improved end-user performance and the ease with which I implemented intelligent caching with the &lt;a href=&#34;https://cran.r-project.org/web/packages/memoise/memoise.pdf&#34;&gt;memoise&lt;/a&gt; package for a consumer decision tree application I am developing. If you care deeply about writing beautiful, clean, efficient code and bringing your data science to the next level, I highly recommend adding &lt;strong&gt;Efficient R Programming&lt;/strong&gt; to your arsenal.&lt;/p&gt;
&lt;p&gt;The book is published by &lt;a href=&#34;https://www.oreilly.com/&#34;&gt;O’Reilly Media&lt;/a&gt; and is available &lt;a href=&#34;https://csgillespie.github.io/efficientR/&#34;&gt;online at the authors’ website&lt;/a&gt;, as well as through &lt;a href=&#34;https://www.safaribooksonline.com/home/&#34;&gt;Safari&lt;/a&gt;.&lt;/p&gt;

        &lt;script&gt;window.location.href=&#39;https://rviews.rstudio.com/2017/05/19/efficient_r_programming/&#39;;&lt;/script&gt;
      </description>
    </item>
    
    <item>
      <title>Some Random Weekend Reading</title>
      <link>https://rviews.rstudio.com/2017/03/24/some-random-weekend-reading/</link>
      <pubDate>Fri, 24 Mar 2017 00:00:00 +0000</pubDate>
      
      <guid>https://rviews.rstudio.com/2017/03/24/some-random-weekend-reading/</guid>
      <description>
        
&lt;script src=&#34;/rmarkdown-libs/htmlwidgets/htmlwidgets.js&#34;&gt;&lt;/script&gt;
&lt;script src=&#34;/rmarkdown-libs/d3/d3.min.js&#34;&gt;&lt;/script&gt;
&lt;script src=&#34;/rmarkdown-libs/forceNetwork-binding/forceNetwork.js&#34;&gt;&lt;/script&gt;

&lt;p&gt;Few of us have enough time to read, and most of us already have depressingly deep stacks of material that we would like to get through. However, sometimes a random encounter with something interesting is all that it takes to regenerate enthusiasm. Just in case you are not going to get to a book store with a good technical section this weekend, here are a few not-quite-random reads.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://www.deeplearningbook.org/&#34;&gt;Deep Learning&lt;/a&gt; by Goodfellow, Bengio and Courville is a solid, self-contained introduction to Deep Learning that begins with Linear Algebra and ends with discussions of research topics such as Autoencoders, Representation Learning, and Boltzman Machines. The online layout extends an invitation to click anywhere and begin reading. Sampling the chapters, I found the text to be engaging reading; much more interesting and lucid than just an online resource. For some Deep Learning practice with R and &lt;a href=&#34;https://h2o-release.s3.amazonaws.com/h2o/rel-slater/9/docs-website/h2o-docs/booklets/DeepLearning_Vignette.pdf&#34;&gt;H2O&lt;/a&gt;, have a look at the post &lt;a href=&#34;http://www.rblog.uni-freiburg.de/2017/02/07/deep-learning-in-r/&#34;&gt;Deep Learning in R&lt;/a&gt; by Kutkina and Feuerriegel.&lt;/p&gt;
&lt;p&gt;However, if you are under the impression that getting a handle on Deep Learning will get you totally up to speed with neural network buzzwords, you may be disappointed. &lt;a href=&#34;https://en.wikipedia.org/wiki/Extreme_learning_machine&#34;&gt;Extreme Learning Machines&lt;/a&gt;, which “aim to break the barriers between the conventional artificial learning techniques and biological learning mechanisms”, are sure to take you even deeper into the abyss. For a succinct introduction to ELMs with and application to handwritten digit classification, have a look at the &lt;a href=&#34;https://www.hindawi.com/journals/cin/2016/3049632/&#34;&gt;recent paper&lt;/a&gt; by Pang and Yang. For more than an afternoon’s worth of reading, browse through the IEEE Intelligent Systems issue on &lt;a href=&#34;http://www.ntu.edu.sg/home/egbhuang/pdf/IEEE-IS-ELM.pdf&#34;&gt;Extreme Learning Machines&lt;/a&gt; &lt;a href=&#34;http://www.ntu.edu.sg/home/egbhuang/&#34;&gt;here&lt;/a&gt;, and the other resources collected &lt;a href=&#34;http://www.ntu.edu.sg/home/egbhuang/pdf/IEEE-IS-ELM.pdf&#34;&gt;here&lt;/a&gt;. See the &lt;a href=&#34;http://www.ntu.edu.sg/home/egbhuang/ELM2014/index.html&#34;&gt;announcement&lt;/a&gt; of the 2014 conference for the full context of the quote above.&lt;/p&gt;
&lt;p&gt;For something a little lighter and closer to home, &lt;a href=&#34;https://christophergandrud.github.io/networkD3/&#34;&gt;Christopher Gandrud’s page&lt;/a&gt; on the &lt;a href=&#34;https://cran.r-project.org/web/packages/networkD3/index.html&#34;&gt;networkD3&lt;/a&gt; package is sure to set you browsing through &lt;a href=&#34;https://en.wikipedia.org/wiki/Sankey_diagram&#34;&gt;Sankey Diagrams&lt;/a&gt; and &lt;a href=&#34;https://cs.brown.edu/~rt/gdhandbook/chapters/force-directed.pdf&#34;&gt;Force Directed Drawing Alorithms&lt;/a&gt;.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;library(networkD3)
# Load data
data(MisLinks)
data(MisNodes)

# Plot
forceNetwork(Links = MisLinks, Nodes = MisNodes,
            Source = &amp;quot;source&amp;quot;, Target = &amp;quot;target&amp;quot;,
            Value = &amp;quot;value&amp;quot;, NodeID = &amp;quot;name&amp;quot;,
            Group = &amp;quot;group&amp;quot;, opacity = 0.8)&lt;/code&gt;&lt;/pre&gt;

&lt;div id=&#34;htmlwidget-49f7dcedcb604b5773a2&#34; style=&#34;width:672px;height:480px;&#34; class=&#34;forceNetwork html-widget&#34;&gt;&lt;/div&gt;
&lt;script type=&#34;application/json&#34; data-for=&#34;htmlwidget-49f7dcedcb604b5773a2&#34;&gt;{&#34;x&#34;:{&#34;links&#34;:{&#34;source&#34;:[1,2,3,3,4,5,6,7,8,9,11,11,11,11,12,13,14,15,17,18,18,19,19,19,20,20,20,20,21,21,21,21,21,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,24,24,25,25,25,26,26,26,26,27,27,27,27,27,28,28,29,29,29,30,31,31,31,31,32,33,33,34,34,35,35,35,36,36,36,36,37,37,37,37,37,38,38,38,38,38,38,39,40,41,41,42,42,42,43,43,43,44,44,45,47,48,48,48,48,49,49,50,50,51,51,51,52,52,53,54,54,54,55,55,55,55,55,55,55,55,55,55,56,56,57,57,57,58,58,58,58,58,59,59,59,59,60,60,60,61,61,61,61,61,61,62,62,62,62,62,62,62,62,63,63,63,63,63,63,63,63,64,64,64,64,64,64,64,64,64,64,65,65,65,65,65,65,65,65,65,65,66,66,66,66,66,66,66,66,66,67,68,68,68,68,68,68,69,69,69,69,69,69,69,70,70,70,70,70,70,70,70,71,71,71,71,71,71,71,71,72,72,72,73,74,74,75,75,75,75,75,75,75,76,76,76,76,76,76,76],&#34;target&#34;:[0,0,0,2,0,0,0,0,0,0,10,3,2,0,11,11,11,11,16,16,17,16,17,18,16,17,18,19,16,17,18,19,20,16,17,18,19,20,21,16,17,18,19,20,21,22,12,11,23,11,24,23,11,24,11,16,25,11,23,25,24,26,11,27,23,27,11,23,30,11,23,27,11,11,27,11,29,11,34,29,34,35,11,29,34,35,36,11,29,34,35,36,37,11,29,25,25,24,25,41,25,24,11,26,27,28,11,28,46,47,25,27,11,26,11,49,24,49,26,11,51,39,51,51,49,26,51,49,39,54,26,11,16,25,41,48,49,55,55,41,48,55,48,27,57,11,58,55,48,57,48,58,59,48,58,60,59,57,55,55,58,59,48,57,41,61,60,59,48,62,57,58,61,60,55,55,62,48,63,58,61,60,59,57,11,63,64,48,62,58,61,60,59,57,55,64,58,59,62,65,48,63,61,60,57,25,11,24,27,48,41,25,68,11,24,27,48,41,25,69,68,11,24,27,41,58,27,69,68,70,11,48,41,25,26,27,11,48,48,73,69,68,25,48,41,70,71,64,65,66,63,62,48,58],&#34;value&#34;:[1,8,10,6,1,1,1,1,2,1,1,3,3,5,1,1,1,1,4,4,4,4,4,4,3,3,3,4,3,3,3,3,5,3,3,3,3,4,4,3,3,3,3,4,4,4,2,9,2,7,13,1,12,4,31,1,1,17,5,5,1,1,8,1,1,1,2,1,2,3,2,1,1,2,1,3,2,3,3,2,2,2,2,1,2,2,2,2,1,2,2,2,2,2,1,1,1,2,3,2,2,1,3,1,1,3,1,2,1,2,1,1,1,3,2,1,1,9,2,2,1,1,1,2,1,1,6,12,1,1,21,19,1,2,5,4,1,1,1,1,1,7,7,6,1,4,15,5,6,2,1,4,2,2,6,2,5,1,1,9,17,13,7,2,1,6,3,5,5,6,2,4,3,2,1,5,12,5,4,10,6,2,9,1,1,5,7,3,5,5,5,2,5,1,2,3,3,1,2,2,1,1,1,1,3,5,1,1,1,1,1,6,6,1,1,2,1,1,4,4,4,1,1,1,1,1,1,2,2,2,1,1,1,1,2,1,1,2,2,3,3,3,3,1,1,1,1,1,1,1,1,1,1,1],&#34;colour&#34;:[&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;,&#34;#666&#34;]},&#34;nodes&#34;:{&#34;name&#34;:[&#34;Myriel&#34;,&#34;Napoleon&#34;,&#34;Mlle.Baptistine&#34;,&#34;Mme.Magloire&#34;,&#34;CountessdeLo&#34;,&#34;Geborand&#34;,&#34;Champtercier&#34;,&#34;Cravatte&#34;,&#34;Count&#34;,&#34;OldMan&#34;,&#34;Labarre&#34;,&#34;Valjean&#34;,&#34;Marguerite&#34;,&#34;Mme.deR&#34;,&#34;Isabeau&#34;,&#34;Gervais&#34;,&#34;Tholomyes&#34;,&#34;Listolier&#34;,&#34;Fameuil&#34;,&#34;Blacheville&#34;,&#34;Favourite&#34;,&#34;Dahlia&#34;,&#34;Zephine&#34;,&#34;Fantine&#34;,&#34;Mme.Thenardier&#34;,&#34;Thenardier&#34;,&#34;Cosette&#34;,&#34;Javert&#34;,&#34;Fauchelevent&#34;,&#34;Bamatabois&#34;,&#34;Perpetue&#34;,&#34;Simplice&#34;,&#34;Scaufflaire&#34;,&#34;Woman1&#34;,&#34;Judge&#34;,&#34;Champmathieu&#34;,&#34;Brevet&#34;,&#34;Chenildieu&#34;,&#34;Cochepaille&#34;,&#34;Pontmercy&#34;,&#34;Boulatruelle&#34;,&#34;Eponine&#34;,&#34;Anzelma&#34;,&#34;Woman2&#34;,&#34;MotherInnocent&#34;,&#34;Gribier&#34;,&#34;Jondrette&#34;,&#34;Mme.Burgon&#34;,&#34;Gavroche&#34;,&#34;Gillenormand&#34;,&#34;Magnon&#34;,&#34;Mlle.Gillenormand&#34;,&#34;Mme.Pontmercy&#34;,&#34;Mlle.Vaubois&#34;,&#34;Lt.Gillenormand&#34;,&#34;Marius&#34;,&#34;BaronessT&#34;,&#34;Mabeuf&#34;,&#34;Enjolras&#34;,&#34;Combeferre&#34;,&#34;Prouvaire&#34;,&#34;Feuilly&#34;,&#34;Courfeyrac&#34;,&#34;Bahorel&#34;,&#34;Bossuet&#34;,&#34;Joly&#34;,&#34;Grantaire&#34;,&#34;MotherPlutarch&#34;,&#34;Gueulemer&#34;,&#34;Babet&#34;,&#34;Claquesous&#34;,&#34;Montparnasse&#34;,&#34;Toussaint&#34;,&#34;Child1&#34;,&#34;Child2&#34;,&#34;Brujon&#34;,&#34;Mme.Hucheloup&#34;],&#34;group&#34;:[1,1,1,1,1,1,1,1,1,1,2,2,3,2,2,2,3,3,3,3,3,3,3,3,4,4,5,4,0,2,3,2,2,2,2,2,2,2,2,4,6,4,4,5,0,0,7,7,8,5,5,5,5,5,5,8,5,8,8,8,8,8,8,8,8,8,8,9,4,4,4,4,5,10,10,4,8]},&#34;options&#34;:{&#34;NodeID&#34;:&#34;name&#34;,&#34;Group&#34;:&#34;group&#34;,&#34;colourScale&#34;:&#34;d3.scale.category20()&#34;,&#34;fontSize&#34;:7,&#34;fontFamily&#34;:&#34;serif&#34;,&#34;clickTextSize&#34;:17.5,&#34;linkDistance&#34;:50,&#34;linkWidth&#34;:&#34;function(d) { return Math.sqrt(d.value); }&#34;,&#34;charge&#34;:-120,&#34;opacity&#34;:0.8,&#34;zoom&#34;:false,&#34;legend&#34;:false,&#34;nodesize&#34;:false,&#34;radiusCalculation&#34;:&#34; Math.sqrt(d.nodesize)+6&#34;,&#34;bounded&#34;:false,&#34;opacityNoHover&#34;:0,&#34;clickAction&#34;:null}},&#34;evals&#34;:[],&#34;jsHooks&#34;:[]}&lt;/script&gt;
&lt;p&gt;Finally, if you are like me and think that the weekends are for catching up on things that you should probably already know, but on which you might be a bit shaky, remember that you can never know enough about GitHub. Compliments of GitHub’s Carolyn Shin, here is some online GitHub reading: &lt;a href=&#34;https://guides.github.com/&#34;&gt;GitHub Guides&lt;/a&gt;, &lt;a href=&#34;https://github.com/github/training-kit&#34;&gt;GitHub on Demand Training&lt;/a&gt;, and an online version of the &lt;a href=&#34;https://git-scm.com/book/en/v2&#34;&gt;Pro Git Book&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Reading recommendations go both ways. Please feel free to comment with some recommendations of your own.&lt;/p&gt;
&lt;div id=&#34;section&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;&lt;/h1&gt;
&lt;/div&gt;

        &lt;script&gt;window.location.href=&#39;https://rviews.rstudio.com/2017/03/24/some-random-weekend-reading/&#39;;&lt;/script&gt;
      </description>
    </item>
    
    <item>
      <title>Book Review: Computer Age Statistical Inference</title>
      <link>https://rviews.rstudio.com/2016/10/28/book-review-computer-age-statistical-inference/</link>
      <pubDate>Fri, 28 Oct 2016 00:00:00 +0000</pubDate>
      
      <guid>https://rviews.rstudio.com/2016/10/28/book-review-computer-age-statistical-inference/</guid>
      <description>
        &lt;p&gt;&lt;a href=&#34;https://www.cambridge.org/core/books/computer-age-statistical-inference/E32C1911ED937D75CE159BBD21684D37&#34;&gt;&lt;em&gt;Computer Age Statistical Inference&lt;/em&gt;&lt;/a&gt;: Algorithms, Evidence and Data Science by Bradley Efron and Trevor Hastie is a brilliant read. If you are only ever going to buy one statistics book, or if you are thinking of updating your library and retiring a dozen or so dusty stats texts, this book would be an excellent choice. In 475 carefully crafted pages, Efron and Hastie examine the last 100 years or so of statistical thinking from multiple viewpoints. In the nominal approach implied by the book&amp;rsquo;s title, they describe the impact of computing on statistics, and point out where powerful computers opened up new territory. On the first page of the preface they write:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&amp;hellip; the role of electronic computation is central to our story. This doesn&amp;rsquo;t mean that every advance was computer-related. A land bridge had opened up to a new continent but not all were eager to cross.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Empirical Bayes and James-Stein estimation, they claim, could have been discovered under the constraints of mid-twentieth-century mechanical computation, but discovering the bootstrap, proportional hazard models, large-scale hypothesis testing, and the machine learning algorithms underlying much of data science required crossing the bridge.&lt;/p&gt;

&lt;p&gt;A second path opened up in this text stops just short of the high ground of philosophy. Efron and Hastie blow by the great divide of the Bayesian versus Frequentist controversy to carefully consider the strengths and weaknesses of the three main systems of statistical inference: Frequentist, Bayesian and Fisherian Inference. You may have thought that Sir Ronald Fisher was a frequentist, but the inspired thoughts of a man of Fisher&amp;rsquo;s intellect are not so easily categorized. Efron and Hastie write:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Sir Ronald Fisher was arguably the most influential anti-Bayesian of all time, but that did not make him a conventional frequentist. His key data analytic methods &amp;hellip; were almost always applied frequentistically. Their Fisherian rationale, however, often drew on ideas neither Bayesian nor frequentist in nature, or sometimes the two in combination.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Above all, in this text, Efron and Hastie are concerned with the clarity of statistical inference. They take special care to explain the nuances of Frequentist, Bayesian and Fisherian thinking, devoting early chapters to each of these conceptual frameworks. In these, they invite the reader to consider a familiar technique from either a Bayesian, Frequentist or Fisherian point of view. Then they raise issues and contrast and compare the merits of each approach. Unstated, but nagging in the back of my mind while reading these chapters, was the implication that there may, indeed, be other paths to the &amp;ldquo;science of learning from experience&amp;rdquo; (the authors&amp;rsquo; definition of statistics) that have yet to be discovered.&lt;/p&gt;

&lt;p&gt;But don&amp;rsquo;t let me mislead you into thinking that &lt;em&gt;Computer Age Statistical Inference&lt;/em&gt; is mere philosophical fluff that doesn&amp;rsquo;t really matter day-to-day. &lt;a href=&#34;https://web.stanford.edu/~hastie/CASI/contents.html&#34;&gt;Have a look at the table of contents&lt;/a&gt;. The book is organized into three parts. &amp;ldquo;Part I: Classic Statistical Inference&amp;rdquo; contains five chapters on classical statistical inference, including a gentle introduction to algorithms and inference, three chapters on the inference systems mentioned above, and a chapter on parametric models and exponential families. &amp;ldquo;Part II: Early Computer-Age Methods&amp;rdquo; has nine chapters on Empirical Bayes, James-Stein Estimation and Ridge Regression, Generalized Linear Models and Regression Trees, Survival Analysis and the EM Algorithm, The Jackknife and the Bootstrap, Bootstrap Confidence Intervals, Cross-Validation and Cp Estimates of Prediction Error, Objective Bayes Inference and MCMC, and Postwar Statistical Inference and Methodology. &amp;ldquo;Part III: Twenty-First-Century Topics&amp;rdquo; dives into the details of large-scale inference and data science, with seven chapters on Large-Scale Hypothesis Testing, Sparse Modeling and the Lasso, Random Forests and Boosting, Neural Networks and Deep Learning, Support Vector Machines and Kernel methods, Inference After Model Selection, and Empirical Bayes Estimation Strategies.&lt;/p&gt;

&lt;p&gt;Efron and Hastie will keep your feet firmly on the ground while they walk you slowly through the details, pointing out what is important, and providing the guidance necessary to keep the whole forest in mind while studying the trees. From the first page, they maintain a unified exposition of their material by presenting statistics as a tension between algorithms and inference. With this in mind, it seems plausible that there really isn&amp;rsquo;t any big disconnect between the strict logic required to think your way through the pitfalls of large-scale hypothesis testing, and the almost cavalier application of machine learning models.&lt;/p&gt;

&lt;p&gt;Nothing Efron and Hastie do throughout this entire trip is pedestrian. For example, their approach to the exponential family of distributions underlying generalized linear models doesn&amp;rsquo;t begin with the usual explanation of link functions fitting into the standard exponential family formula. Instead, they start with a Poisson family example, deriving a 2 parameter general expression for the family and showing how &amp;ldquo;&lt;a href=&#34;https://stat.ethz.ch/R-manual/R-devel/library/boot/html/exp.tilt.html&#34;&gt;tilting&lt;/a&gt;&amp;rdquo; the distribution by multiplying by an exponential parameter permits the derivation of other members of the family. The example is interesting in its own right, but the payoff, which comes a couple of pages later, is argument demonstrating how a generalization of the technique keeps the number of parameters required for inference under repeated sampling from growing without bound.&lt;/p&gt;

&lt;p&gt;A great pedagogical strength of the book is the &amp;ldquo;Notes and Details&amp;rdquo; section concluding each chapter. Here you will find derivation details, explanations of Frequentist, Bayesian and Fisherian inference, and remarks of historical significance. The Epilogue ties everything together with a historical perspective that outlines how the focus of statistical progress has shifted between Applications, Mathematics and Computation throughout the twentieth century and the early part of this century.&lt;br /&gt;
&lt;em&gt;Computer Age Statistical Inference&lt;/em&gt; contains no code, but it is clearly an R-informed text with several plots and illustrations. The &lt;a href=&#34;https://web.stanford.edu/~hastie/CASI/data.html&#34;&gt;data sets provided on Efron&amp;rsquo;s website&lt;/a&gt;, and the pseudo-code placed throughout the text are helpful for replicating much of what is described. The website points to the &lt;a href=&#34;https://cran.r-project.org/web/packages/boot/index.html&#34;&gt;boot&lt;/a&gt; and &lt;a href=&#34;https://cran.r-project.org/web/packages/bootstrap/index.html&#34;&gt;bootstrap&lt;/a&gt; packages, and provides the &lt;a href=&#34;https://web.stanford.edu/~hastie/CASI_files/COMPS/accel.R&#34;&gt;code&lt;/a&gt; for a function used in the notes to the chapter on bootstrap confidence intervals.&lt;/p&gt;

&lt;p&gt;My take on &lt;em&gt;Computer Age Statistical Inference&lt;/em&gt; is that experienced statisticians will find it helpful to have such a compact summary of twentieth-century statistics, even if they occasionally disagree with the book&amp;rsquo;s emphasis; students beginning the study of statistics will value the book as a guide to statistical inference that may offset the dangerously mind-numbing experience offered by most introductory statistics textbooks; and the rest of us non-experts interested in the details will enjoy hundreds of hours of pleasurable reading.&lt;/p&gt;

&lt;p&gt;Finally, for those of you who won&amp;rsquo;t buy a book without thumbing through it, PD Dr. Pablo Emilio Verde has you covered.&lt;/p&gt;

&lt;iframe width=&#34;100%&#34; height=&#34;315&#34; src=&#34;https://www.youtube.com/embed/Qg60kyi3ZjU&#34; frameborder=&#34;0&#34; allowfullscreen&gt;&lt;/iframe&gt;

        &lt;script&gt;window.location.href=&#39;https://rviews.rstudio.com/2016/10/28/book-review-computer-age-statistical-inference/&#39;;&lt;/script&gt;
      </description>
    </item>
    
  </channel>
</rss>
