ChatGPT: How to use ChatGPT to make a Shiny App (an Excel Analyzer)

[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.

Hey guys, welcome back to my R-tips newsletter. In today’s R-Tip, I’m sharing the cheat code to making an R shiny web app that automatically analyzes your Excel Files. Plus, I’m sharing exactly how I made it in under 15 minutes. AND how you can do it for ANY company. Let’s go!

Table of Contents

Today I share how to automate Google Sheets with ChatGPT + R. Here’s what you’re learning today:

  • How to use ChatGPT to make a Shiny App: How to iteratively prompt and improve your app with ChatGPT + R.
  • 15-Minute Case Study: Exactly how I made this app in under 15 minutes.

Auto Excel Analyzer Shiny App

The R Shiny App you create in this tutorial


SPECIAL ANNOUNCEMENT: ChatGPT for Data Scientists Workshop on October 18th

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):

ChatGPT for Data Scientists

What: ChatGPT for Data Scientists

When: Wednesday October 18th, 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 walks you through how to use ChatGPT + R + Shiny for this Excel Spreadsheet Analyzer automation. 👇

How to use ChatGPT to make a Shiny App:

The Excel Analyzer in R Shiny App is a powerful tool that enables users to create an Excel spreadsheet analyzer in just 10-15 minutes. By the end of this guide, readers will have a comprehensive understanding of the tool and can access a free ChatGPT workshop tailored for data scientists.

Auto Excel Analyzer Shiny App

Get the Excel Spreadsheet Analyzer Shiny App Here

Basic App Overview:

The foundational version of this app facilitates the uploading of Excel data for visualization purposes.

  • The Excel spreadsheet and R Shiny App can be accessed R-Tips Newsletter
  • The files are located in the /070_chatgpt_excel folder

Users can upload Excel files:

Upload Excel

Pick any excel file with a date column, value column, and optional facet column. Here’s what the sample data looks like:

Excel Spreadsheets

Get the Excel Spreadsheet Here

Users can get a data preview:

Users can preview the data before visualizing it. This feature is especially useful so people know exactly how the incoming data looks.

Data Preview

Users can visualize the data:

Users can effortlessly select columns, such as “date” and “sales”, to instantly view the corresponding plots. The app’s primary purpose is to empower users to swiftly visualize sales data and other vital metrics.

Visualize Data

15-Minute Case Study: Exactly how I made this app in under 15 minutes.

For those new to ChatGPT, it is an advanced tool that can be employed to produce code seamlessly. For instance, a command can be given to ChatGPT to craft an R Shiny app embedded with a Plotly visualization. Upon generation, this code can be executed to display a fully-functional app.

And then you can iterate on the app to make it better. That’s how I made this app in under 15 minutes… Iteration.

Auto Excel Analyzer Shiny App

Get the Excel Spreadsheet Analyzer Shiny App Here

Adopting an Iterative Process with ChatGPT:

Instead of requesting ChatGPT to produce an exhaustive solution at once, it’s often more efficient to adopt an iterative methodology. By issuing smaller, more precise prompts to ChatGPT, users can methodically construct their desired solution, building on each previous step.

See My Process in Action [YouTube Video]:

The best spot to go is this video to see me build the Shiny app with ChatGPT live:

My Exact ChatGPT Prompts:

Here’s are the ChatGPT prompts that I used to build the Shiny App:

  • Prompt 1 (Excel Uploader): Create a foundational shiny app that facilitates the uploading of user Excel files.

  • Prompt 2 (Add Visualization): Enhance the app to permit users to visualize data by selecting a specific date column in juxtaposition with a value column.

  • Prompt 3 (Include Sample Data in App): Integrate sample data into the app. This feature enables users to acquaint themselves with the app’s capabilities even without a personal Excel dataset.

  • Prompt 4 (Preview Sample Data): Introduce a preview option so that users can glimpse the data before initiating the visualization process.

  • Prompt 5 (Select Date Column): This is an essential feature that provides users with the autonomy to choose which column they aspire to visualize.

  • Prompt 6 (Incorporate an Optional Facet Column): Refine the app further by granting users the option to pinpoint a facet column for their visualization.

Error Handling with ChatGPT: Errors are an integral part of the development process. When an error surfaces in visualization, ChatGPT can be a valuable asset for debugging. By inputting the error message, users can obtain potential resolutions, like the suggestion to deploy the GGplot2 library.

Get the Shiny App (and Dissect it)

You can get a copy of everything you need to make the Shiny App here:

Get the Shiny App

Get the Excel Spreadsheet Analyzer Shiny App + Code Here

Conclusions:

By leveraging ChatGPT, users can not only expedite the R Shiny app development process but can also troubleshoot effectively, making it an invaluable asset for both novice and seasoned developers.

However, ChatGPT is not a replacement for R. It is a tool that can be used to augment the development process. It is not a substitute for learning R.

If you are struggling to become a Data Scientist with R, then please read on…

Struggling to become a data scientist?

You know the feeling. Being unhappy with your current job.

Promotions aren’t happening. You’re stuck. Feeling Hopeless. Confused…

And you’re praying that the next job 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 6,107+ 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 the system they are taking:

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)