<div>
<span><h1>Yihaaa <span></span>
<span><h2>Ce graphe est généré par R et c'est de la balle.<span></span>
<span>&lt;img</span> <span>src =</span><span> </span><span>&quot;http://127.0.0.1:3953/whoplot&quot;</span><span>></span>
<span></span>
<span></span>



<p><strong>As {plumber}, by default, produces JSON content (but you can pass a<br>
lot of other types of content), if can be easily integrated into any web<br>
page</strong>. That means you can make R do all the heavy computation, and just<br>
get the result as a JSON to be integrated on your webpage.</p>
<ul>
<li>The API definition :<br>
<a rel="nofollow" href="https://github.com/ColinFay/conf/blob/master/2018-06-Web2Day-Nantes/api.R" target="_blank">https://github.com/ColinFay/conf/blob/master/2018-06-Web2Day-Nantes/api.R</a></li>
<li>Launching the API :<br>
<a rel="nofollow" href="https://github.com/ColinFay/conf/blob/master/2018-06-Web2Day-Nantes/api.Rmd" target="_blank">https://github.com/ColinFay/conf/blob/master/2018-06-Web2Day-Nantes/api.Rmd</a></li>
</ul>
<h2>About Shiny</h2>
<h3>Using Shiny to produce web app</h3>
<p>Shiny is an amazing framework from RStudio, used to <strong>produce web app<br>
that can run R</strong>, written with R code: meaning that it can run any R<br>
model, use any R dataviz library, take advantage of R file importing<br>
packages, etc etc.</p>
<p>Creating Shiny apps has been one of our main area of work at<br>
<a rel="nofollow" href="https://rtask.thinkr.fr/design-and-deployment-of-shiny-applications/" target="_blank">ThinkR</a><br>
lately, and <strong>we’ve build quite large applications that run complex<br>
model, which are then visualised in the same app</strong>. What’s the point of<br>
this app? To give access to these models to people who don’t know how to<br>
code (and don’t want to).</p>
<h3>Basic Shiny Designs</h3>
<p>When designing a Shiny app, you can use a lot of already implemented<br>
design libraries and templates. <strong>These produce nice results, and<br>
everything can be written in R, which makes it easy to use for R<br>
developers who don’t know html, css and JS</strong> (even if we can definitely<br>
say that when it comes to building large applications, you should at<br>
some point learn at least html and css).</p>
<p>These basics packages produce contents like the one I’m showing in the<br>
talk:</p>
<p><img alt="" src="https://i0.wp.com/colinfay.me/assets/img/dashboard_example.png?w=456&ssl=1" data-recalc-dims="1"></p>
<p>Here, I’m <strong>creating a little dashboard that connects to Twitter, and<br>
does simple dataviz, counting, and text-mining</strong>. Everything, here, done<br>
in R.</p>
<blockquote>
<p>Note: this app will be made open-source one day, when I’ll have found<br>
some times to finish it <img alt="🙂" src="https://s.w.org/images/core/emoji/2.4/72x72/1f642.png" class="wp-smiley"></p>
</blockquote>
<h3>Advanced Shiny design</h3>
<p>Or, what I call: Webdev + R = <img alt="❤" src="https://s.w.org/images/core/emoji/2.4/72x72/2764.png" class="wp-smiley"></p>
<p>When <strong>doing more advanced Shiny designs</strong>, we can use htmlTemplates (a<br>
feature which is not known enough). This functionnality allows you to<br>
create html and css templates as any web developer would do. And of<br>
course, with JS in it if you want to.</p>
<p>Once you’ve got this template, you can use it straight in Shiny.</p>
<p>For example:</p>
<div>
<div>
<pre><code># styles.css
body {
 font-family: 'Source Sans
Pro', Helvetica, sans-serif;
 background: #121212;
 color: #999;
 padding: 20px;
}
tr {
 vertical-align: top;
}
...
</code></pre>
</div>
</div>
<p></p>
<p>These html and css templates are “easy” (well, relatively easy) to<br>
implement if you’re a web designer. But, let’s be honnest, they are<br>
really hard to code if you’re a data scientist.</p>
<p>From the R point of view, this is as simple as creating a function that<br>
does:</p>
<div>
<div>
<pre><code><span>horizontalBox</span><span> </span><span>&lt;-</span><span> </span><span>function</span><span>(</span><span>title</span><span>,</span><span> </span><span>content</span><span>){</span><span>
</span><span>htmlTemplate</span><span>(</span><span>&quot;box.html&quot;</span><span>,</span><span> </span><span>title</span><span> </span><span>=</span><span> </span><span>title</span><span>,</span><span> </span><span>content</span><span> </span><span>=</span><span> </span><span>content</span><span>)</span><span>
</span><span>}</span><span>
</span></code></pre>
</div>
</div>
<p>You can recognize here that I am calling the box.html template, with the<br>
arguments of the function being the elements between {.</p>
<p><img alt="" src="https://i0.wp.com/colinfay.me/assets/img/horizontal_shiny.png?w=456&ssl=1" data-recalc-dims="1"></p>
<h2>Might we work together?</h2>
<p><strong>I am not a web designer, and web designers are not data scientists, so<br>
neither of us can pretend to do a better job than the other. But the<br>
good news is that everything is there for us to work together.</strong></p>
<p>So, if ever some web designer is interested to work with me on a Shiny<br>
app (everything open source of course), I’ll be glad to do so, as I’m<br>
sure we have a lot to learn from each other.</p>
<p>Feel free to out to me throught mail or on<br>
<a rel="nofollow" href="https://twitter.com/_ColinFay" target="_blank">twitter</a>!</p>
<h2>Slides</h2>
<p>The slides from the talk are available<br>
here:</p>
<p><a rel="nofollow" href="https://github.com/ColinFay/conf/blob/master/2018-06-Web2Day-Nantes/web2day.pdf" target="_blank">https://github.com/ColinFay/conf/blob/master/2018-06-Web2Day-Nantes/web2day.pdf</a></p>
<p>The content of the .R, Rmd, etc, are here:</p>
<p><a rel="nofollow" href="https://github.com/ColinFay/conf/tree/master/2018-06-Web2Day-Nantes" target="_blank">https://github.com/ColinFay/conf/tree/master/2018-06-Web2Day-Nantes</a></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://colinfay.me/web-dev-r/"> Colin Fay</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/lwAb-j6KIIo" height="1"></a></div></h2></span></h1></span></div>