A new R package for Business Analytics... radiant
Written by Matt Dancho
I’m super impressed by the
radiant R package. With no prior experience with radiant, I was able to complete a short business analytics report in under 10-minutes.
SPECIAL ANNOUNCEMENT: How To Become A 6-Figure Business Scientist (Even In A Recession) on June 28th
Inside the workshop I’ll share how to become exactly what companies need right now (and earn 17% more than a data scientist):
What: How To Become A 6-Figure Business Scientist (Even In A Recession)
When: Wednesday June 28th, 2pm EST
How It Will Help You: Data science in 2023 has changed. The 10+ person data science team is out. And the one-person Business Scientist is in. I’ll show you how to become a 1-person data science team inside my LIVE 6-figure business scientist masterclass.
Price: Does Free sound good?
How To Join: 👉 Register Here
This article is part of R-Tips Weekly, a weekly video tutorial that shows you step-by-step how to do common R coding tasks.
Here are the links to get set up. 👇
See how in 10-minutes I made a quick business analytics report with
What you make in this R-Tip
By the end of this tutorial, you’ll use Radiant to create a reproducible Business Analytics Report and save it as HTML.
Reproducible Business Analytics Report (made with
Thank You Developers
Before we go any further, I want to say thanks to the open source developers of Radiant. The programmer that graciously developed
radiant and has given it to us free of charge is Vincent Nijs.
Follow these instructions to set up the
radiant package and tutorial.
- Install Radiant
- Load the libraries and data
radiant() (there’s also an Add-In if you use Rstudio)
Radiant’s Shiny UI
This opens up the Radiant Shiny User Interface, a Shiny App that runs locally in a new Google Chrome Window.
Step 1 - Working with Data
Next, lets load our data. I added data into the Rstudio Global Environment previously when I ran
One of the options is to load data from the Global Environment, so let’s do this.
Step 2 - Visualize
We can make a quick plot to investigate the sales data over time by Sales ID (store - department identifier). This highlights the differing sales trends by Store-Department.
- Head over the Visualize Section within the Data Tab
- Select Line Plot, and Y-Axis will be Weekly Sales, X-Axis is Date, and Facet Row is ID
- Click Create Plot to make the visualization
Step 3 - Starting the Report
At this point we can begin building our report.
- On the Visualize Section, scroll down and click the little report icon
- This send you to the Report Tab where you can Knit report
Bada-Bing… Bada Boom! We have the beginnings of a Business Analytics Report.
Step 4 - Modeling (Creating a Price Model)
The next step in our workflow is to model the weekly sales data. My goal is to create a Pricing Model that looks for dependencies between the weekly sales volume by department and factors like markups, fuel price, temperature (weather), etc. We can easily do this in
Head over to the Model Tab and select Linear Regression (OLS).
- First select Weekly Sales as the response variable and select the explanatory variables shown.
- Then click Estimate Model to make a linear regression model
- Review the OLS Linear regression summary results. This is our very basic pricing model.
Bonus - Residual & Coefficient Plots
As a bonus for making it this far, I’m showing you how you can quickly make some awesome visuals for your Business Analytics Report.
This plot helps us see how well the model is performing. It’s worth mentioning that we are seeing a lot of clusters, which means a non-linear model may be a better model.
This plot helps us see the effect of a 1-unit change to the modeled price. It appears that the model is very sensitive to Fuel Price. Keep in mind that the units are important for comparison.
- A change in $1 of fuel price is a lot.
- A change in 1-degree Fahrenheit for Temperature is not that much.
Step 5 - Finish the Report
Once we are happy, we can finish our report. Just hit the “Report Button” to send the results from the Modeling Tab to the Report Tab.
On the reporting tab:
- Add a title and sections to your report
- Move the code chunks to follow the order
- Hit Save Report (I saved as HTML in the Youtube Video)
The report is saved as an HTML document (assuming you switched from Notebook to HTML like I did in the video.)
You just created a report using
radiant. But there’s a lot more to data science.
If you’d like to become a data scientist (and have an awesome career, improve your quality of life, enjoy your job, and all the fun that comes along), then I can help with that.
Do You Need Help Becoming A Business Data Scientist Right Now?
YOU know the feeling. Being unhappy with your current job.
Promotions aren’t happening. You’re stuck. Hopeless. Confused…
And you’re praying that the next data science interview will go better than the last 12…
… But you know it won’t. Not unless you take control of your career.
The good news is…
I Can Help You Speed It Up.
I’ve helped 5,897+ students learn data science for business from an elite business consultant’s perspective.
I’ve worked with Fortune 500 companies like S&P Global, Apple, MRM McCann, and more.
And I built a training program that gets my students life-changing data science careers (don’t believe me? see my testimonials here):
6-Figure Data Science Job at CVS Health ($125K)
Senior VP Of Analytics At JP Morgan ($200K)
50%+ Raises & Promotions ($150K)
Lead Data Scientist at Northwestern Mutual ($175K)
2X-ed Salary (From $60K to $120K)
2 Competing ML Job Offers ($150K)
Promotion to Lead Data Scientist ($175K)
Data Scientist Job at Verizon ($125K+)
Data Scientist Job at CitiBank ($100K + Bonus)
Whenever you are ready, here’s how I can help you:
Here’s the system that has gotten aspiring data scientists, career transitioners, and life long learners data science jobs and promotions…
Join My 5-Course R-Track Program
(And Become The Data Scientist You Were Meant To Be...)
P.S. - Samantha landed her NEW Data Science R Developer job at CVS Health (Fortune 500). This could be you.