Hey guys, welcome back to my R-tips newsletter. Supply chain management is essential in making sure that your company’s business runs smoothly. One of the key elements is managing inventory efficiently. Today, I’m going to show you how to estimate inventory and forecast inventory levels using the planr
package in R. Let’s dive in!
Here’s what you’ll learn in this article:
planr
Package to Project Inventories
Get the Code (In the R-Tip 084 Folder)
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 October 23rd, 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 is the link to get set up.
planr
PackageSupply chain management is all about balancing supply and demand to ensure that inventory levels are optimized. Overestimating demand leads to excess stock, while underestimating it causes shortages. Accurate inventory projections allow businesses to plan ahead, make data-driven decisions, and avoid costly errors like over-buying inventory or getting into a stock-outage and having no inventory to meet demand.
planr
PackageThe planr
package simplifies inventory management by projecting future inventory levels based on supply, demand, and current stock levels.
planr
Let’s take a look at how to use planr
to optimize your supply chain. We’ll go through a quick tutorial to get you started using planr
to project and manage inventories.
First, you need to install the required packages and load the libraries. Run this code:
Get the Code (In the R-Tip 087 Folder)
This data contains supply and demand information for various demand fulfillment units (DFUs) over a period of time.
The first step in understanding supply chain performance is visualizing demand trends. We can use timetk::plot_time_series()
to get a clear view of the demand fluctuations. Run this code:
Get the Code (In the R-Tip 087 Folder)
This code will produce a set of time series plots that show how demand changes over time for each DFU. By visualizing these trends, you can identify patterns and outliers that may impact your projections.
Once you have a good understanding of demand, the next step is to project your future inventory levels. The planr::light_proj_inv()
function helps you do this. Run this code:
Get the Code (In the R-Tip 087 Folder)
This function takes in the DFU, Period, Demand, Opening stock, and Supply as inputs to project inventory levels over time by item. The output is a data frame that contains the projected inventories for each period and DFU.
To make your projections more interactive and accessible, you can create an interactive table using reactable
and reactablefmtr
. I’ve made a function to automate the process for you based on the planr
’s awesome documentation. Run this code:
Get the Code (In the R-Tip 087 Folder)
This generates a beautiful interactive table where you can filter and sort the projected inventories. Interactive tables make it easier to analyze your data and share insights with your team.
By using the planr
package, you can project inventory levels with ease, helping you manage your supply chain more effectively. This leads to better decision-making, reduced stockouts, and lower carrying costs.
But there’s more to mastering supply chain analysis in R.
If you would like to grow your Business Data Science skills with R, then please read on…
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):
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 Now!
(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.