ChatGPT: Made this Shiny App in 10 Minutes
Written by Matt Dancho
What if you could 100X your coding productivity? Well you can with ChatGPT.
One of the areas I’m most excited about is speeding up the development process of
Shiny web apps. And in this tutorial I’m going to show you how I built an app in 10 minutes with ChatGPT.
Table of Contents
Today I’m going to show you how to build a
shiny with ChatGPT Here’s what you’re learning today:
- Tutorial Part 1: How to use ChatGPT Prompts to progressively build a
shiny web app
- Bonus: Steal my app library for this R-Tip
SPECIAL ANNOUNCEMENT: ChatGPT for Data Scientists Workshop on June 7th
Inside the workshop I’ll share how I built a Machine Learning Powered Production Shiny App with
ChatGPT (extends this data analysis to an insane production app):
What: ChatGPT for Data Scientists
When: Wednesday June 7th, 2pm EST
How It Will Help You: Whether you are new to data science or are an expert, ChatGPT is changing the game. There’s a ton of hype. But how can ChatGPT actually help you become a better data scientist and help you stand out in your career? I’ll show you inside my free chatgpt for data scientists workshop.
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. Pretty cool, right?
Here are the links to get set up. 👇
This Tutorial is Available in Video
I have a companion video tutorial that gives you the bonus “progressively built” 4
shiny app versions in this video (plus walks you through how to use them). And, I’m finding that a lot of my students prefer the dialogue that goes along with coding. So check out this video to see me running the code in this tutorial. 👇
Why ChatGPT is a Must (No Hype Version)
chatgpt is a game changer. No question about it.
chatgpt perfect? No.
Am I faster when using
chatgpt for “AI assisted programming”? Yes.
Will a beginner data scientist take my job? Heck no.
But you know who will take my job?
Someone that’s faster at getting results than me.
I’m talking other experts that are learning how to use
chatgpt to their advantage.
Are you worried now?
Well let’s start calming those nerves… Good ole’ Matt Dancho is here to the rescue.
Today, I’m going to introduce you to
chatgpt by making a
Before we dive in…
Free Gift: Cheat Sheet for my Top 100 R Packages (Special Advanced Analysis Topics Included)
You’re going to point chatgpt in the right direction. And this little cheat sheet gives you the specific packages that you can ask ChatGPT to use.
chatgpt by giving you an edge over those that don’t have it. In fact, it’s my secret weapon…
Even I forget which R packages to use from time to time. And this cheat sheet saves me so much time. Instead of googling to filter through 20,000 R packages to find a needle in a haystack. I keep my cheat sheet handy so I know which to use and when to use them. Seriously. This cheat sheet is my bible.
Once you download it, head over to page 3 and you’ll see several R packages I use frequently just for Data Analysis.
Which is important when you want to work in these fields:
- Machine Learning
- Time Series
- Financial Analysis
- Geospatial Analysis
- Text Analysis and NLP
- Shiny Web App Development (see page 2)
So steal my cheat sheet. It will save you a ton of time.
Tutorial: How to Make a
Shiny App in 10 Minutes with
Time to build a
shiny app with AI assistance from
chatgpt. Let’s have some fun!
Step 1: Open Up Rstudio & Chatgpt
First, open up an Rstudio Session and
chatgpt I have them stacked sideways here. (Don’t worry if you don’t have a shiny app yet. We’ll create it in this tutorial)
Get the code.
Step 2: Get A Project Idea and Prompt ChatGPT to Build It
My project idea was a “monthly expense calculator”.
I figured this would be easy to build because it requires no data (csv files), and I can test out
chatgpt capabilities quickly.
Here’s my first prompt:
Then head over to Rstudio and run the code. We get a very basic
shiny app that calculates monthly expenses.
Get the code.
Step 2: Begin stacking
This is an iterative process where I now request additions and changes to functionality.
First, I use the key words: Update the app.
And then I request what updates I want to have the app changed.
Once the updated code is generated by
chatgpt, I copy and test it out inside of Rstudio.
Get the code.
Step 3: Continue Stacking Prompts
Next, I progressively request updates and changes to the app as I see things I’d like changed. Each time I run the code in Rstudio to see what impact the changes have.
First, I update the app to allow the user to add multiple months.
Next, I request the visualization to be changed to a bar plot.
Then I ask for the columns to be stacked on top of each other.
And the final shiny app is produced:
Bonus: Steal my app library for this R-Tip
Want all the code I just showed you? Steal my app library.
The code for the 4 apps are inside of R-Tip
Steal my shiny apps from this tutorial.
You learned how to use
chatgpt to make a shiny app in 10 minutes. Great work! But, there’s a lot more to becoming a data scientist.
If you’d like to become a Business 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.