pp_complete: Complete a policy portfolio

View source: R/pp_complete.R

pp_completeR Documentation

Complete a policy portfolio

Description

Complete an already tidy dataset with the full set of instruments, targets and years. Used also to specify the order of instruments and targets.

Usage

pp_complete(
  D,
  year.range = NULL,
  Instrument.set = NULL,
  Target.set = NULL,
  date = FALSE
)

Arguments

D

Data frame in a tidy format with the following columns: "Country", "Sector", "Year", "Instrument", "Target" and "covered". "covered" is a binary identificator of whether the portfolio space is covered by policy intervention (1) or not (0). The remaining columns identify the case. Notice that "Year" is a numeric value, while the remaining 4 case identifiers are factors.

year.range

Numerical vector of length two with the initial and final value of the years considered

Instrument.set

Ordered factor with the full set of values of Instruments, to be combined with the already existing Instruments.

Target.set

Ordered factor with the full set of values of Targets, to be combined with the already existing Targets.

date

By default a portfolio by every year is employed. Otherwise, use a full date (DD-MM-YYYY).

Value

D Data frame in a tidy format with the following columns: "Country", "Sector", "Year", "Instrument", "Target" and "covered". "covered" is a binary identificator of whether the portfolio space is covered by policy intervention (1) or not (0). The remaining columns identify the case. Notice that "Year" is a numeric value, while the remaining 4 case identifiers are factors. It differs from the input in that this one includes the full set of pre-specified Instruments, Targets and temporal range.

Examples

data(P.education)
range(P.education$Year)

P.education.full <- pp_complete(P.education, year.range = c(2000, 2035))
range(P.education.full$Year)

PolicyPortfolios documentation built on March 18, 2022, 5:36 p.m.