<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/extending-accessibility-of-open-source-statistical-software-to-the-masses-a-shiny-case-study/"></div></div><div><a data-url="https://www.r-bloggers.com/extending-accessibility-of-open-source-statistical-software-to-the-masses-a-shiny-case-study/" data-counturl="https://www.r-bloggers.com/extending-accessibility-of-open-source-statistical-software-to-the-masses-a-shiny-case-study/" data-count="horizontal" data-text="Extending accessibility of open-source statistical software to the masses A shiny case study" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://educate-r.org//2016/10/07/canam.html"> Educate-R - R</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<section>
<h1>Extending accessibility of open-source statistical software to the masses: A shiny case study</h1>
<h2>Brandon LeBeau</h2>
<h3>University of Iowa</h3>
</section>
<section>
<h1>R</h1>
<ul>
<li>R is an open source statistical programming language.
<ul>
<li>Pros:
<ul>
<li>Common statistical procedures are found in R</li>
<li>Can extend functionality with packages/functions</li>
</ul>
</li>
<li>Cons:
<ul>
<li>Need to be comfortable with code<br>

</li>
</ul>
</li>
</ul>
</li>
</ul>
<section>
<h1>Flexibility of R</h1>
<ul>
<li>R is powerful and flexible due to the many user written packages.</li>
<li>However, to capture this flexibility:
<ul>
<li>users need to be comfortable with programming</li>
<li>users need to find the package</li>
<li>users need to understand package specific syntax<br>

</li>
</ul>
</li>
</ul>
<section>
<h1>R package documentation and examples</h1>
<p><a target="_blank" href="https://www.rdocumentation.org/packages/dplyr/versions/0.5.0/topics/summarise">https://www.rdocumentation.org/packages/dplyr/versions/0.5.0/topics/summarise</a><br>
</section>

<section>
<h1>Blog posts</h1>
<p><a target="_blank" href="https://blog.rstudio.org/2014/01/17/introducing-dplyr/">https://blog.rstudio.org/2014/01/17/introducing-dplyr/</a><br>
</section>

<section>
<h1>Vignettes</h1>
<p><a target="_blank" href="https://cran.rstudio.com/web/packages/dplyr/vignettes/introduction.html">https://cran.rstudio.com/web/packages/dplyr/vignettes/introduction.html</a><br>
</section>

<section>
<h1>Weaknesses of these types of documentations</h1>
<ul>
<li>They still rely on user understanding and reading R code.</li>
<li>Not interactive, although the user can copy and paste code into an R session.</li>
<li>This type of documentation will not capture the nontraditional useR.</li>
<li>Shiny is the path to the nontraditional useR.<br>

</li>
</ul>
<section>
<h1>What is Shiny</h1>
<ul>
<li>Shiny is an open-source framework for creating applications viewed in a web browser with R.</li>
<li>Shiny Examples:
<ul>
<li><a target="_blank" href="http://shiny.rstudio.com/gallery/movie-explorer.html">http://shiny.rstudio.com/gallery/movie-explorer.html</a></li>
<li><a target="_blank" href="https://gallery.shinyapps.io/drinkr/">https://gallery.shinyapps.io/drinkr/</a></li>
<li><a target="_blank" href="http://wordbank.stanford.edu/analyses?name=item_trajectories">http://wordbank.stanford.edu/analyses?name=item_trajectories</a><br>

</li>
</ul>
</li>
</ul>
<section>
<h1>Advantages of Shiny</h1>
<ul>
<li>User needs no R knowledge</li>
<li>App is viewed in the browser so able to use
<ul>
<li>Javascript</li>
<li>HTML</li>
<li>CSS</li>
</ul>
</li>
<li>Multiple hosting options</li>
<li>Flexible Output<br>

</li>
</ul>
<section>
<h1>Disadvantages of Shiny</h1>
<ul>
<li>Need a R developer to create the app.
<ul>
<li>More difficult as the code is somewhat different compared to traditional R code.</li>
<li>Shiny uses reactive programming.<br>

</li>
</ul>
</li>
</ul>
<section>
<h1>Components of Shiny</h1>
<ol>
<li>User Interface (ui.r)
<ul>
<li>What the user sees and interacts with</li>
</ul>
</li>
<li>R Analysis (server.r)
<ul>
<li>The R code running behind the scenes<br>

</li>
</ul>
</li>
</ol>
<section>
<h1>User Interface</h1>
<ul>
<li>Simple user interface example from RStudio
<ul>
<li><a target="_blank" href="http://shiny.rstudio.com/gallery/telephones-by-region.html">http://shiny.rstudio.com/gallery/telephones-by-region.html</a></li>
</ul>
</li>
</ul>
<pre><code>shinyUI(
  fluidPage(    
    titlePanel(&quot;Telephones by region&quot;),
    sidebarLayout(      
      sidebarPanel(
        selectInput(&quot;region&quot;, &quot;Region:&quot;, 
                    choices = colnames(WorldPhones)),
        hr(),
        helpText(&quot;Data from AT&amp;T (1961) The World's Telephones.&quot;)
      ),

      mainPanel(
        plotOutput(&quot;phonePlot&quot;)  
      )
    )
  )
)
</code></pre>
</section>
<section>
<h1>Server File</h1>
<ul>
<li>The server file for RStudio example
<ul>
<li><a target="_blank" href="http://shiny.rstudio.com/gallery/telephones-by-region.html">http://shiny.rstudio.com/gallery/telephones-by-region.html</a></li>
</ul>
</li>
</ul>
<pre><code>shinyServer(function(input, output) {

  output$phonePlot &lt;- renderPlot({

    barplot(WorldPhones[ , input$region] * 1000, 
            main = input$region,
            ylab = &quot;Number of Telephones&quot;,
            xlab = &quot;Year&quot;)
  })
})
</code></pre>
</section>
<section>
<h1>Case Study</h1>
<ul>
<li>pdfsearch
<ul>
<li>Note, you may need <em>rtools</em> to install this package.</li>
</ul>
</li>
<li>This following commands will run the pdfsearch shiny application locally.
<ul>
<li>Note, the following packages are required: shiny, shinydashboard, pdfsearch, DT<br>
<a target="_blank" href="https://github.com/lebebr01/pdfsearch">https://github.com/lebebr01/pdfsearch</a></li>
</ul>
</li>
</ul>
<pre><code>install.packages('devtools')
devtools::install_github('lebebr01/pdfsearch')
pdfsearch::run_shiny()
</code></pre>
</section>
<section>
<h1>Case Study 2</h1>
<ul>
<li>simglm
<ul>
<li>Note, need the following packages: shiny, shinydashboard, DT, simglm, ggplot2, lme4, highcharter<br>
<a target="_blank" href="https://github.com/lebebr01/simglm">https://github.com/lebebr01/simglm</a></li>
</ul>
</li>
</ul>
<pre><code>devtools::install_github('lebebr01/simglm')
simglm::run_shiny()
</code></pre>
</section>
<section>
<h1>Conclusions</h1>
<ul>
<li>Shiny can give useRs an interactive framework to try out an R package.</li>
<li>Benefits include
<ul>
<li>interactivity</li>
<li>no errors (for well developed Shiny applications)</li>
<li>no need to learn R or package specific syntax</li>
<li>only need a browser, no need to have R install locally when hosted on a server.<br>

</li>
</ul>
</li>
</ul>
<section>
<h1>Questions?</h1>
<ul>
<li>Twitter: @blebeau11</li>
<li>Website: <a target="_blank" href="http://educate-r.org/">http://educate-r.org</a></li>
<li>Slides: <a target="_blank" href="http://educate-r.org/2016/10/07/canam.html">http://educate-r.org/2016/10/07/canam.html</a></li>
<li>GitHub: <a target="_blank" href="http://github.com/lebebr01">http://github.com/lebebr01</a><br>

</li>
</ul>
<p><div><div><div><div data-width="55" data-show-faces="false" data-send="true" data-layout="box_count" data-height="62" data-href="https://www.r-bloggers.com/extending-accessibility-of-open-source-statistical-software-to-the-masses-a-shiny-case-study/"></div></div><div><a data-url="https://www.r-bloggers.com/extending-accessibility-of-open-source-statistical-software-to-the-masses-a-shiny-case-study/" data-counturl="https://www.r-bloggers.com/extending-accessibility-of-open-source-statistical-software-to-the-masses-a-shiny-case-study/" data-count="vertical" data-text="Extending accessibility of open-source statistical software to the masses A shiny case study" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://educate-r.org//2016/10/07/canam.html"> Educate-R - R</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 title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/?s=data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/?s=Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/?s=time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/?s=trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/q2DKqV4ZPyg"></a></div></section></section></section></section></section></section></section></section></section>