<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Excel on R Views</title>
    <link>https://rviews.rstudio.com/tags/excel/</link>
    <description>Recent content in Excel on R Views</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 16 May 2018 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://rviews.rstudio.com/tags/excel/" rel="self" type="application/rss+xml" />
    
    
    
    
    <item>
      <title>Enterprise Dashboards with R Markdown</title>
      <link>https://rviews.rstudio.com/2018/05/16/replacing-excel-reports-with-r-markdown-and-shiny/</link>
      <pubDate>Wed, 16 May 2018 00:00:00 +0000</pubDate>
      
      <guid>https://rviews.rstudio.com/2018/05/16/replacing-excel-reports-with-r-markdown-and-shiny/</guid>
      <description>
        


&lt;p&gt;&lt;em&gt;This is a second post in a series on enterprise dashboards. See our previous post, &lt;a href=&#34;https://rviews.rstudio.com/2017/09/20/dashboards-with-r-and-databases/&#34;&gt;Enterprise-ready dashboards with Shiny Databases&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;We have been living with spreadsheets for so long that most office workers think it is obvious that spreadsheets generated with programs like &lt;a href=&#34;https://products.office.com/en-us/excel&#34;&gt;Microsoft Excel&lt;/a&gt; make it easy to understand data and communicate insights. Everyone in a business, from the newest intern to the CEO, has had some experience with spreadsheets. But using Excel as the de facto analytic standard is problematic. Relying exclusively on Excel produces environments where it is almost impossible to organize and maintain efficient operational workflows. In addition to fostering low productivity, organizations risk profits and reputations in an age where insightful analyses and process control translate to a competitive advantage. Most organizations want better control over accessing, distributing, and processing data. You can use the R programming language, along with with R Markdown reports and RStudio Connect, to build enterprise dashboards that are robust, secure, and manageable.&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2018-05-16-replacing-excel-with-r-markdown-and-shiny/tracker-excel.png&#34; width=&#34;400&#34; /&gt;

&lt;/div&gt;
&lt;p&gt;This Excel dashboard attempts to function as a real application by allowing its users to filter and visualize key metrics about customers. It took dozens of hours to build. The intent was to hand off maintenance to someone else, but the dashboard was so complex that the author was forced to maintain it. Every week, the author copied data from an ETL tool and pasted it into the workbook, spot checked a few cells, and then emailed the entire workbook to a distribution list. Everyone on the distribution list got a new copy in their inbox every week. There were no security controls around data management or data access. Anyone with the report could modify its contents. The update process often broke the brittle cell dependencies; or worse, discrepancies between weeks passed unnoticed. It was almost impossible to guarantee the integrity of each weekly report.&lt;/p&gt;
&lt;div id=&#34;why-coding-is-important&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Why coding is important&lt;/h3&gt;
&lt;p&gt;Excel workbooks are hard to maintain, collaborate on, and debug because they are not reproducible. The content of every cell and the design of every chart is set without ever recording the author’s actions. There is no simple way to recreate an Excel workbook because there is no recipe (i.e., set of instructions) that describes how it was made. Because Excel workbooks lack a recipe, they tend to be hard to maintain and prone to errors. It takes care, vigilance, and subject-matter knowledge to maintain a complex Excel workbook. Even then, human errors abound and changes require a lot of effort.&lt;/p&gt;
&lt;p&gt;A better approach is to write code. There are many &lt;a href=&#34;https://twitter.com/MaartenvSmeden/status/995791001825431552&#34;&gt;reasons to start programming&lt;/a&gt;. When you create a recipe with code, anyone can reproduce your work (including your future self). The act of coding implicitly invites others to collaborate with you. You can systematically validate and debug your code. All of these things lead to better code over time. Coding in R has particular advantages given its vast ecosystem of packages, its vibrant community, and its powerful tool chain.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;using-r-markdown&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Using R Markdown&lt;/h3&gt;
&lt;p&gt;There are many tools for replacing complex Excel dashboards with R code. One of these tools is &lt;a href=&#34;https://rmarkdown.rstudio.com/&#34;&gt;R Markdown&lt;/a&gt;, an open-source R package that turns your analyses into high quality documents, reports, presentations and dashboards. R Markdown documents are fully reproducible and support dozens of output formats including HTML, PDF, and Microsoft Word documents.&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2018-05-16-replacing-excel-with-r-markdown-and-shiny/tracker-rmd.png&#34; width=&#34;400&#34; /&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a href=&#34;http://colorado.rstudio.com/rsc/tracker-report/tracker-report.html&#34;&gt;Here&lt;/a&gt; is the same Excel dashboard translated to an R Markdown report. Because this report is written in code, it is vastly simpler and easier to maintain. Like the Excel dashboard above, this R Markdown report is designed to take user inputs so that it could render custom report versions.&lt;/p&gt;
&lt;p&gt;Many people are already aware that R Markdown reports combine narrative, code, and output in a single document. What is less commonly known is that you can generalize any R Markdown report by declaring parameters in the document header. R Markdown documents with parameters are known as &lt;a href=&#34;https://rmarkdown.rstudio.com/developer_parameterized_reports.html&#34;&gt;parameterized reports&lt;/a&gt;. In the Excel dashboard users can select &lt;code&gt;segment&lt;/code&gt;, &lt;code&gt;group&lt;/code&gt;, and &lt;code&gt;period&lt;/code&gt;. In a parameterized R Markdown document, you would specify these inputs with the following YAML header:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;---
title: Customer Tracker Report
output: html_notebook
params:
  seg: 
    label: &amp;quot;Segment:&amp;quot;
    value: Total
    input: select
    choices: [Total, Heavy, Mainstream, Focus1, Focus2, 
              Specialty, Diverse1, Diverse2, Other, New]
  grp: 
    label: &amp;quot;Group:&amp;quot;
    value: Total
    input: select
    choices: [Total, Core, Extra]
  per: 
    label: &amp;quot;Period:&amp;quot;
    value: Week
    input: radio
    choices: [Week, YTD]
---&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can then call the parameters you declare in the YAML header from your R code chunks.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;```{r}
params$segment
params$grp
params$per
```&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can render the document with different inputs by selecting &lt;a href=&#34;https://rmarkdown.rstudio.com/developer_parameterized_reports.html#parameter_user_interfaces&#34;&gt;knit with parameters&lt;/a&gt; in RStudio. This option will open a user interface that allows you to select the parameters you want.&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;https://media.giphy.com/media/vwicMYfRPL6YuRQGfo/giphy.gif&#34; /&gt;

&lt;/div&gt;
&lt;p&gt;If you want to automate the process of creating custom report versions, you can render these documents programmatically with the &lt;code&gt;rmarkdown::render()&lt;/code&gt; function.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;rmarkdown::render(
  input = &amp;quot;tracker-report.Rmd&amp;quot;, 
  params = list(seg = &amp;quot;Focus1&amp;quot;, grp = &amp;quot;Core&amp;quot;, per = &amp;quot;Weekly&amp;quot;)
)&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;publishing-to-rstudio-connect&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Publishing to RStudio Connect&lt;/h3&gt;
&lt;p&gt;Managing access and permissions for an ocean of Excel files is painful. Data in Excel spreads through an organization without controls like a virus spreads through a body without disease prevention. There are better ways to secure the operation, access, and distribution of information.&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;https://media.giphy.com/media/9M52kMrLHrDfxI3nrq/giphy.gif&#34; /&gt;

&lt;/div&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2018-05-16-replacing-excel-with-r-markdown-and-shiny/pb-publishing.png&#34; width=&#34;50&#34; /&gt;

&lt;/div&gt;
&lt;p&gt;RStudio Connect is a server product from RStudio that is designed for secure sharing of R content. It is on-premises software you run behind your firewall. You keep control of your data and of who has access. With RStudio Connect, you can see all your content, decide who should be able to view and collaborate on it, tune performance, schedule updates, and view logs. You can schedule your R Markdown reports to run automatically or even distribute the latest version by email.&lt;/p&gt;
&lt;p&gt;When you publish a parameterized R Markdown report to RStudio Connect, an interface appears for selecting inputs. Viewers can create new report versions, then email themselves a copy. Collaborators can save and schedule new report versions, then email others a copy. You can even attach &lt;a href=&#34;http://docs.rstudio.com/connect/1.6.2/user/r-markdown.html#r-markdown-output-files&#34;&gt;output files&lt;/a&gt; to these versions. Using parameterized R Markdown documents in RStudio Connect is a powerful way to communicate information.&lt;/p&gt;
&lt;p&gt;You can publish content from the RStudio IDE by clicking the &lt;a href=&#34;https://support.rstudio.com/hc/en-us/articles/228270928-Push-button-publishing-to-RStudio-Connect&#34;&gt;Publish button&lt;/a&gt; that looks like a blue Eye of Horus. Pressing this button will begin the publishing process. First, it creates a set of instructions for recreating your content. Second, it deploys your content bundle to the server. Third, it recreates your content on RStudio Connect. Push-button publishing has a long history of being used with RStudio. In 2012, RStudio enabled push-button publishing of R Markdown documents to &lt;a href=&#34;https://rpubs.com/&#34;&gt;RPubs&lt;/a&gt;. In 2014, RStudio enabled push-button publishing of Shiny apps to &lt;a href=&#34;http://www.shinyapps.io/&#34;&gt;shinyapps.io&lt;/a&gt;. In 2016, RStudio enabled push-button publishing to &lt;a href=&#34;https://www.rstudio.com/products/connect/&#34;&gt;RStudio Connect&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;adding-shiny&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Adding Shiny&lt;/h3&gt;
&lt;p&gt;R Markdown documents are rendered with batch processing. That makes them ideal for automation, long running workflows, and custom report versions. However, if you want your documents to be immediately reactive to user input, then you can add a Shiny runtime. These &lt;a href=&#34;https://rmarkdown.rstudio.com/authoring_shiny.html&#34;&gt;interactive documents&lt;/a&gt; behave like a Shiny application in that they must be hosted. You can host &lt;a href=&#34;https://rmarkdown.rstudio.com/authoring_shiny.html&#34;&gt;interactive documents&lt;/a&gt; and &lt;a href=&#34;http://shiny.rstudio.com/&#34;&gt;Shiny applications&lt;/a&gt; with RStudio Connect. Deciding when to choose between R Markdown, interactive documents, and Shiny applications is a subject for a later post.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;summary&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;p&gt;Reproducible code in R leads to better analysis and collaboration. You can use parameterized R Markdown reports to create complex, interactive dashboards. Hosting these dashboards securely in RStudio Connect gives you control over accessing, distributing, and processing data. You can use the R programming language, along with with R Markdown reports and RStudio Connect, to build enterprise dashboards that are robust, secure, and manageable.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Click &lt;a href=&#34;https://github.com/sol-eng/customer-tracker&#34;&gt;here&lt;/a&gt; for source code.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;

        &lt;script&gt;window.location.href=&#39;https://rviews.rstudio.com/2018/05/16/replacing-excel-reports-with-r-markdown-and-shiny/&#39;;&lt;/script&gt;
      </description>
    </item>
    
    <item>
      <title>Three Tips for Training Excel Users in R</title>
      <link>https://rviews.rstudio.com/2017/02/10/three-tips-for-training-excel-users-in-r/</link>
      <pubDate>Fri, 10 Feb 2017 00:00:00 +0000</pubDate>
      
      <guid>https://rviews.rstudio.com/2017/02/10/three-tips-for-training-excel-users-in-r/</guid>
      <description>
        

&lt;p&gt;“I’m not a coder” or “I was never good at math” is a frequent refrain I hear when I ask professionals about their data analysis skills. Through popular culture and stereotypes, most people who don’t have a background in programming automatically underestimate their ability to create amazing things with code. However, Data Society has proven that this is a false narrative through our training program – with students in over 20 countries and many government and enterprise clients, we’ve seen so-called “non-coders” proficiently put together automated data cleaning code scripts and analyses within a few weeks. So how do we do it? Well, we’ve singled out three key steps to get someone started on their journey to an amazing skill set and more powerful data analytics:&lt;/p&gt;
&lt;ol style=&#34;list-style-type: decimal&#34;&gt;
&lt;li&gt;&lt;strong&gt;Start simple&lt;/strong&gt;. My first time training up a group of instructors to teach R programming was a great experience (especially given that these R trainings will train up under-served adults), but it wasn’t without its challenges. Anyone with a non-programming background can feel intimidated when they get started, and it’s critical to start off by using R as a glorified calculator. Start with basic operations to get your students comfortable with the interface of RStudio (an awesome and intuitive interface for R), then you can move on to more advanced functions.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&#34;/post/2017-01-30-three-tips-for-training-excel-users-in-r_files/excel1.png&#34; /&gt; See? This doesn’t look so complicated.&lt;/p&gt;
&lt;ol start=&#34;2&#34; style=&#34;list-style-type: decimal&#34;&gt;
&lt;li&gt;&lt;strong&gt;Show the similarities&lt;/strong&gt;. Excel and R do have many similarities in syntax that makes it easier for Excel users to transfer their skills over to R. For example, RStudio has a tabular data view that may look very familiar to spreadsheet users:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2017-01-30-three-tips-for-training-excel-users-in-r_files/excel2.png&#34; /&gt;

&lt;/div&gt;
&lt;p&gt;This looks like another program I’ve used before…&lt;/p&gt;
&lt;p&gt;And this is not just limited to viewing data. There is a lot of syntax from Excel that is easily transferable to R. For example, using if-else statements in Excel looks like this:&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2017-01-30-three-tips-for-training-excel-users-in-r_files/excel3.png&#34; /&gt;

&lt;/div&gt;
&lt;p&gt;And here is what it looks like in R:&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2017-01-30-three-tips-for-training-excel-users-in-r_files/excel4.png&#34; /&gt;

&lt;/div&gt;
&lt;p&gt;The learning curve for R is a fast one, especially for Excel users. Highlighting those similarities puts new users at ease and gives them a way to connect R functionality to the functionality they already use in Excel.&lt;/p&gt;
&lt;ol start=&#34;3&#34; style=&#34;list-style-type: decimal&#34;&gt;
&lt;li&gt;&lt;strong&gt;Bring out the wow factor&lt;/strong&gt;. One of the main advantages of R is its amazing visualizations and advanced analysis that are not even possible in many more basic tools. Our “wow factor” is the collaboration project we did with the White House initiative, The Opportunity Project, which aimed to connect federal agencies with tech companies to build out tools with their open data. In a couple of short weeks, our team combined several disparate open data sources and built an interactive application entirely in R to provide schools and superintendents with a community resource mapper.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2017-01-30-three-tips-for-training-excel-users-in-r_files/excel5.png&#34; /&gt;

&lt;/div&gt;
&lt;p&gt;Showing students how to eliminate duplicates from data sets with 1 – 2 lines of code or quickly manipulating data into a different format is a wow factor in the amount of time it can save regular Excel users. The applications are immediately apparent for those who have struggled to go through thousands of rows manually or upload a data set with millions of records.&lt;/p&gt;
&lt;p&gt;R is gaining in popularity, with millions of users worldwide and growing. Not only that, but we’ve seen an increase in demand for data analysis skills across all job sectors. Adding R programming and data analysis to your resume can add $10,000 - $15,000 to your salary. With that type of incentive, both in pay and in time saved, there’s no better time to take the “not” out of “I’m not a coder”.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The &lt;a href=&#34;https://goo.gl/Alq5nj&#34;&gt;Data Society&lt;/a&gt; is a data science training platform for professionals. Among other government and corporate clients, Data Society has trained staff at the Department of Commerce and the U.S. Army through their enterprise firm, &lt;a href=&#34;https://goo.gl/gSj7Ot&#34;&gt;Data Society Solutions&lt;/a&gt;, which provides customized corporate data science training and consulting services. If you’d like to learn more, please email &lt;a href=&#34;mailto:solutions@datasociety.co&#34;&gt;solutions@datasociety.co&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

        &lt;script&gt;window.location.href=&#39;https://rviews.rstudio.com/2017/02/10/three-tips-for-training-excel-users-in-r/&#39;;&lt;/script&gt;
      </description>
    </item>
    
  </channel>
</rss>
