Title: | Tools for Supply Chain Management, Demand and Supply Planning |
Version: | 0.5.1 |
Description: | Perform flexible and quick calculations for Demand and Supply Planning, such as projected inventories and coverages, as well as replenishment plan. For any time bucket, daily, weekly or monthly, and any granularity level, product or group of products. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
Imports: | dplyr, tidyr, lubridate, magrittr, RcppRoll |
URL: | https://github.com/nguyennico/planr |
BugReports: | https://github.com/nguyennico/planr/issues |
Depends: | R (≥ 4.1.0) |
LazyData: | true |
Suggests: | highcharter, knitr, reactable, reactablefmtr, rmarkdown, shiny, tidyverse, sparkline, DT, DiagrammeR, networkD3, testthat (≥ 3.0.0) |
VignetteBuilder: | knitr |
Config/testthat/edition: | 3 |
NeedsCompilation: | no |
Packaged: | 2025-02-23 09:50:33 UTC; PR048069 |
Author: | Nicolas Nguyen [aut, cre] |
Maintainer: | Nicolas Nguyen <nikonguyen@yahoo.fr> |
Repository: | CRAN |
Date/Publication: | 2025-02-23 10:00:02 UTC |
Pipe operator
Description
See magrittr::%>%
for details.
Usage
lhs %>% rhs
Arguments
lhs |
A value or the magrittr placeholder. |
rhs |
A function call using the magrittr semantics. |
Value
The result of calling rhs(lhs)
.
blueprint
Description
This dataset contains the basic features to calculate projected inventories and coverages. And also 2 additional info: a minimum and maximum targets of stock coverage. We can apply on it the proj_inv() function, it will return calculated projected inventories and coverages as well as an analysis of the position of the projected inventories versus the minimum and maximum stocks targets.
Usage
data(blueprint)
Format
A data frame with 520 rows and 7 variables
Details
DFU, an item
Period, a date
Demand, a consumption in units
Opening, available inventories at the beginning in units
Supply, a Replenishment Plan in units
Min.Cov, a Minimum Stocks Targets in number of Periods
Max.Cov, a Maximum Stocks Targets in number of Periods
Author(s)
Nicolas Nguyen nikonguyen@yahoo.fr
blueprint_drp
Description
This dataset contains the basic features to calculate a Replenishment Plan (also called DRP) and its related projected inventories and coverages. We can apply on it the drp() function, it will return the calculated Replenishment Plan and its related projected inventories and coverages.
Usage
data(blueprint_drp)
Format
A data frame with 520 rows and 9 variables
Details
DFU, an item
Period, a date
Demand, a consumption in units
Opening, available inventories at the beginning in units
Supply, a Replenishment Plan in units
FH, defines the Frozen and Free Horizon. It has 2 values: Frozen or Free. If Frozen : no calculation of Replenishment Plan yet, the calculation starts when the period is defined as Free. We can use this parameter to consider some defined productions plans or supplies (allocations, workorders,...) in the short-term for example.
SSCov, the Safety Stock Coverage, expressed in number of periods
DRPCovDur the Frequency of Supply, expressed in number of periods
MOQ the Multiple Order Quantity, expressed in units, 1 by default or a Minimum Order Quantity
Author(s)
Nicolas Nguyen nikonguyen@yahoo.fr
blueprint_light
Description
This dataset contains the basic features to calculate projected inventories and coverages. Just 5 features are needed for this: a DFU, a Period, a Demand, an initial Opening Inventory and a Supply Plan. We can apply on it the light_proj_inv() function, it will return calculated projected inventories and coverages.
Usage
data(blueprint_light)
Format
A data frame with 520 rows and 5 variables
Details
DFU, an item
Period, a date
Demand, a consumption in units
Opening, available inventories at the beginning in units
Supply, a Replenishment Plan in units
Author(s)
Nicolas Nguyen nikonguyen@yahoo.fr
Calculates the Projected Inventories and Coverages as well as the Constrained Demand and informs a Tag about the part of the Demand already covered by the Opening Inventories
Description
Calculates the Projected Inventories and Coverages as well as the Constrained Demand and informs a Tag about the part of the Demand already covered by the Opening Inventories
Usage
const_dmd(dataset, DFU, Period, Demand, Opening, Supply)
Arguments
dataset |
a dataframe with the demand and supply features for an item per period |
DFU |
name of an item, a SKU, or a node like an item x location |
Period |
a period of time monthly or weekly buckets for example |
Demand |
the quantity of an item planned to be consumed in units for a given period |
Opening |
the opening inventories of an item in units at the beginning of the horizon |
Supply |
the quantity of an item planned to be supplied in units for a given period |
Value
a dataframe with the calculated Projected Inventories and Coverages as well as the Constrained Demand and a Tag informing the part of the Demand already covered by the Opening Inventories
Examples
const_dmd(dataset = demo_const_dmd, DFU, Period, Demand, Opening, Supply)
demo_const_dmd
Description
This dataset contains the basic features to calculate projected inventories and coverages. Just 5 features are needed for this: a DFU, a Period, a Demand, an initial Opening Inventory and a Supply Plan. The idea is to use this dataset to calculate a constrained demand for each Product, on top of the projected inventories & coverages. A constrained demand is a possible demand, which can be answered considering the projected inventories. Then we can apply on this dataset the const_dmd() function, it will add 2 variables : a Constrained.Demand and a Current.Stock.Available.Tag . The Constrained.Demand is the Demand which can be answered considering the projected inventories, i.e which quantity can be answered and when it can be answered. The Current.Stock.Available.Tag informs the part of the Demand which is already covered by the Opening Inventories.
Usage
data(demo_const_dmd)
Format
A data frame with 144 rows and 5 variables
Details
DFU, an item
Period, a date
Demand, a consumption in units
Opening, available inventories at the beginning in units
Supply, a Replenishment Plan in units
Author(s)
Nicolas Nguyen nikonguyen@yahoo.fr
demo_in_transit
Description
This dataset contains the detailed ETA and ETD for the current and next in transit, as well as the Transit Time for a defined DFU. ETA stands for Estimated Time of Arrival. ETD stands for Estimated Time of Departure. There are 2 types of in transit : the current in transit and the next one, not yet shipped. There are 6 variables in this dataset: a DFU, a Period, an ETA Current Goods In Transit, an ETD & ETA Next Goods In Transit, and a Transit Time. Note that the diffrence between ETD and ETA is the Transit Time. The idea is to use this dataset to project the Goods In Transit. We can apply on this dataset the proj_git() function, it will calculate the Proj.GIT which gathers the current and next In Transit quantities.
Usage
data(demo_in_transit)
Format
A data frame with 447 rows and 6 variables
Details
DFU, a location and an item
Period, a date in weekly bucket format
ETA.Current, some quantities currently in transit displayed at their ETA date in units
ETA.Next, some quantities to be shipped, not yet in transit, displayed at their ETA date in units
ETD.Next, some quantities to be shipped, not yet in transit, displayed at their ETD date in units
TLT, the Transit Lead Time, expressed in weeks, represents the difference between ETA and ETD dates
Author(s)
Nicolas Nguyen nikonguyen@yahoo.fr
demo_monthly_dmd
Description
This dataset contains a set of Monthly Demand for two Products. There are 3 variables: a DFU, a Monthly Period, a Monthly Demand. The idea is to use this dataset to convert the Demand from Monthly into Weekly bucket. We can apply on this dataset the month_to_week() function, it will create a weekly bucket Period and convert the Demand from Monthly into Weekly bucket.
Usage
data(demo_monthly_dmd)
Format
A data frame with 24 rows and 3 variables
Details
DFU, an item
Period, a date in monthly format
Demand, a consumption in units
Author(s)
Nicolas Nguyen nikonguyen@yahoo.fr
Calculates a Replenishment Plan (also called DRP : Distribution Requirement Planning) and the related Projected Inventories and Coverages
Description
Calculates a Replenishment Plan (also called DRP : Distribution Requirement Planning) and the related Projected Inventories and Coverages
Usage
drp(dataset, DFU, Period, Demand, Opening, Supply, SSCov, DRPCovDur, MOQ, FH)
Arguments
dataset |
a dataframe with the demand and supply features for an item per period |
DFU |
name of an item, a SKU, or a node like an item x location |
Period |
a period of time monthly or weekly buckets for example |
Demand |
the quantity of an item planned to be consumed in units for a given period |
Opening |
the opening inventories of an item in units at the beginning of the horizon |
Supply |
the quantity of an item planned to be supplied in units for a given period |
SSCov |
the Safety Stock Coverage, expressed in number of periods |
DRPCovDur |
the Frequency of Supply, expressed in number of periods |
MOQ |
the Multiple Order Quantity, expressed in units, 1 by default or a multiple of a Minimum Order Quantity |
FH |
defines the Frozen and Free Horizon. It has 2 values: Frozen or Free. If Frozen : no calculation of Replenishment Plan yet, the calculation starts when the period is defined as Free. We can use this parameter to consider some defined productions plans or supplies (allocations, workorders,...) in the short-term for example. |
Value
a dataframe with the calculated Replenishment Plan and related Projected inventories and Coverages
Examples
drp(dataset = blueprint_drp, DFU, Period, Demand, Opening, Supply, SSCov, DRPCovDur, MOQ, FH)
Calculates projected inventories and coverages
Description
Calculates projected inventories and coverages
Usage
light_proj_inv(dataset, DFU, Period, Demand, Opening, Supply)
Arguments
dataset |
a dataframe with the demand and supply features for an item per period |
DFU |
name of an item, a SKU, or a node like an item x location |
Period |
a period of time monthly or weekly buckets for example |
Demand |
the quantity of an item planned to be consumed in units for a given period |
Opening |
the opening inventories of an item in units at the beginning of the horizon |
Supply |
the quantity of an item planned to be supplied in units for a given period |
Value
a dataframe with the calculated projected inventories and coverages and the related analysis
Examples
light_proj_inv(dataset = blueprint_light, DFU, Period, Demand, Opening, Supply)
Convert a Demand expressed in Monthly buckets into Weekly buckets
Description
Convert a Demand expressed in Monthly buckets into Weekly buckets
Usage
month_to_week(dataset, DFU, Period, Demand)
Arguments
dataset |
a dataframe with the demand in monthly bucket for each item |
DFU |
name of an item, a SKU, or a node like an item x location |
Period |
a monthly period of time that we want to convert into weekly buckets |
Demand |
the quantity of an item planned to be consumed in units for a given period |
Value
a dataframe with the Demand expressed in weekly buckets for each item
Examples
month_to_week(dataset = demo_monthly_dmd, DFU, Period, Demand)
Convert a Demand expressed in Monthly buckets into Weekly buckets
Description
Convert a Demand expressed in Monthly buckets into Weekly buckets
Usage
month_to_weekx(dataset, DFU, W1, W2, W3, W4, Period, Demand)
Arguments
dataset |
a dataframe with the demand in monthly bucket for each item |
DFU |
name of an item, a SKU, or a node like an item x location |
W1 |
percentage of demand done during the first week |
W2 |
percentage of demand done during the second week |
W3 |
percentage of demand done during the third week |
W4 |
percentage of demand done during the fourth week |
Period |
a monthly period of time that we want to convert into weekly buckets |
Demand |
the quantity of an item planned to be consumed in units for a given period |
Value
a dataframe with the Demand expressed in weekly buckets for each item
Examples
month_to_week(dataset = demo_monthly_dmd, DFU, Period, Demand)
Calculates the projected in transit for a defined DFU
Description
Calculates the projected in transit for a defined DFU
Usage
proj_git(dataset, DFU, Period, ETA.Current, ETA.Next, ETD.Next, TLT)
Arguments
dataset |
a dataframe which contains the different variable below for each DFU |
DFU |
name of a node, which is an item x location |
Period |
a period of time, expressed in weekly bucket |
ETA.Current |
quantities currently in transit displayed at their ETA date in units |
ETA.Next |
quantities to be shipped, not yet in transit, displayed at their ETA date in units |
ETD.Next |
quantities to be shipped, not yet in transit, displayed at their ETD date in units |
TLT |
Transit Lead Time, expressed in weeks, represents the difference between ETA and ETD dates |
Value
a dataframe with the projected in transit quantity calculated for each DFU
Examples
proj_git(dataset = demo_in_transit, DFU, Period, ETA.Current, ETA.Next, ETD.Next, TLT)
Calculates projected inventories and coverages and perform an analysis vs stocks targets
Description
Calculates projected inventories and coverages and perform an analysis vs stocks targets
Usage
proj_inv(dataset, DFU, Period, Demand, Opening, Supply, Min.Cov, Max.Cov)
Arguments
dataset |
a dataframe with the demand and supply features for an item per period |
DFU |
name of an item, a SKU, or a node like an item x location |
Period |
a period of time monthly or weekly buckets for example |
Demand |
the quantity of an item planned to be consumed in units for a given period |
Opening |
the opening inventories of an item in units at the beginning of the horizon |
Supply |
the quantity of an item planned to be supplied in units for a given period |
Min.Cov |
minimum stocks target of an item expressed in periods |
Max.Cov |
maximum stocks target of an item expressed in periods |
Value
a dataframe with the calculated projected inventories and coverages and the related analysis
Examples
proj_inv(dataset = blueprint, DFU, Period, Demand, Opening, Supply, Min.Cov, Max.Cov)
slob
Description
This dataset contains the detailed Opening Inventories for two Products. There are 4 variables: a DFU, a Period, a Demand and the breakdown of the Opening Inventories by expiry date or minimum Remaining Shelf Life for use. The idea is to use this dataset to calculate the Short Shelf Life quantities, called here SSL Qty. We can apply on this dataset the ssl() function, it will calculate a SSL Qty field.
Usage
data(slob)
Format
A data frame with 44 rows and 4 variables
Details
DFU, an item
Period, a date in monthly format
Demand, a consumption in units
Opening, the breakdown of the opening inventories in units by expiry date
Author(s)
Nicolas Nguyen nikonguyen@yahoo.fr
Calculates the short shelf life of an opening inventories, also called obsolescence risks
Description
Calculates the short shelf life of an opening inventories, also called obsolescence risks
Usage
ssl(dataset, DFU, Period, Demand, Opening)
Arguments
dataset |
a dataframe with the demand in weekly or monthly bucket for each item |
DFU |
name of an item, a SKU, or a node like an item x location |
Period |
a period of time, expressed in monthly or weekly bucket |
Demand |
the quantity of an item planned to be consumed in units for a given period |
Opening |
the breakdown of the opening inventories by expiry date, or percentage of minimum remaining shelflife for use |
Value
a dataframe with the SSL.Qty related to the Opening Inventories of each item
Examples
ssl(dataset = slob, DFU, Period, Demand, Opening)