A script is reproducible when anyone who runs it on the same data gets the same answer. Three habits get you most of the way.
Seeds. Random draws, such as slice_sample() for an audit or a train and test split, change every run unless you call set.seed(2026) first. With the same seed, R draws the same rows on every machine.
Checks. stopifnot(!anyDuplicated(df$order_id), !anyNA(df$units)) stops the script with an error when the data breaks an assumption, instead of quietly producing a wrong report. A warning isn't enough: the script carries on.
Parameters. Put the inputs that change (a cut-off date, a region, a threshold) in named objects at the top, or make them function arguments, so next month's run changes one line. Watch one trap: inside filter(), an argument with the same name as a column is read as the column, so filter(region == region) keeps every row.
A repeatable sample, a check that stops on bad data, and a parameter at the top.