Compute Pre-existing contracts modified after the crisis indicator
Source:R/08-pre-exist-contracts-ext-after-emerg-outb.R
ind_8.Rd
The indicator reveals whether a contracting authority/company has at least one pre-existing contract with respect to the emergency outbreak (i.e., with a call before the beginning of the emergency), which has been modified after the emergency outbreak, with reference to relevant economic market.
Motivation
The red flag considers at risk the contracting authority/company with existing contracts before the emergency outbreak and subsequently modified through variants after the emergency began; this assessment excludes modifications made immediately thereafter, using a parametric window (e.g., within the following six months).
Arguments
- data
a dataframe containing the data to use for computing the indicator.
- publication_date
name of the variable in
data
containing the publication date of each contract.- stat_unit
name of the variable in
data
containing the target unit ID (in this case, company or contracting authority).- variant_date
name of the variable in
data
containing the date of occurrence for each contract variant.- emergency_name
string specifying the name of the emergency to consider. Examples could include "Coronavirus" or "Terremoto Centro Italia 2016-2017".
- months_win
parametric time window (in months) from the emergency outbreak. Only contract modifications made after this window are considered.
- ...
other parameters to pass to
generate_indicator_schema()
, such ascountry_name
(default: Italy).
Value
indicator schema as from generate_indicator_schema()
.
Examples
if (FALSE) {
if (interactive()) {
mock_data_core <- mock_data_core |>
tidyr::unnest(varianti, keep_empty = TRUE)
ind_8(
data = mock_data_core,
publication_date = data_pubblicazione,
stat_unit = cf_amministrazione_appaltante,
variant_date = data_approvazione_variante,
months_win = 6,
emergency_name = "coronavirus"
)
}
}