ChatGPT: Made this Shiny App in 10 Minutes

[This article was first published on business-science.io, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

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 R 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

ChatGPT Made This Shiny App


Special Announcement: ChatGPT for Data Scientists Workshop

ChatGPT for Data Scientists

What: ChatGPT for Data Scientists

When: Wednesday April 5th, 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.


R-Tips Weekly

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 just Sped Me Up 100X

Listen, chatgpt is a game changer. No question about it.

Is 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 shiny app.

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.

It complements 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.

Ultimate R Cheat Sheet

Once you download it, head over to page 3 and you’ll see several R packages I use frequently just for Data Analysis.

Cheat Sheet Page 3 Special Topics

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 ChatGPT

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)

Rstudio and ChatGPT

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:

Shiny ChatGPT 1

Then head over to Rstudio and run the code. We get a very basic shiny app that calculates monthly expenses.

Shiny ChatGPT App 1

Get the code.

Step 2: Begin stacking chatgpt prompts

This is an iterative process where I now request additions and changes to functionality.

Shiny ChatGPT 2

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.

Shiny ChatGPT 2

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.

Shiny ChatGPT 3

Next, I request the visualization to be changed to a bar plot.

Shiny ChatGPT 4

Then I ask for the columns to be stacked on top of each other.

Shiny ChatGPT 5

And the final shiny app is produced:

Shiny ChatGPT 5

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 060_chatgpt_shiny.

Shiny ChatGPT 6

Steal my shiny apps from this tutorial.

💡 Conclusions

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…

What They're Doing - 5 Course R-Track

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.

Success Samantha Got The Job

To leave a comment for the author, please follow the link and comment on their blog: business-science.io.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)