Learn R Programming

convergEU (version 0.7.3.2)

departure_best: Departures from the best country

Description

For each country the departure from the best performing Member State is calculated. Then, differences are cumulated over years.

Usage

departure_best(oriTB, timeName = "time", indiType = "highBest")

Value

a list with component res which contains the departures from the best performer (for each country and for each year) and the cumulated differences over years.

Arguments

oriTB

original dataset (tibble) with time by country values.

timeName

string with the name of the time variable in oriTB.

indiType

the type of indicator 'highBest' (default) or 'lowBest'.

References

https://www.eurofound.europa.eu/system/files/2022-04/introduction-to-the-convergeu-package-0.6.4-tutorial-v2-apr2022.pdf

Examples

Run this code

# Example 1
# Sorted dataframe in the format years by countries:
require(tibble)
testTB <- dplyr::tribble(
~time, ~countryA ,  ~countryB,  ~countryC,
2000,     0.8,   2.7,    3.9,
2001,     1.2,   3.2,    4.2,
2002,     0.9,   2.9,    0.1,
2003,     1.3,   2.9,    1.0,
2004,     1.2,   3.1,    4.1,
2005,     1.2,   3.0,    4.0
)

# Departures from the best country according to the indicator higher is the best:
mySTB <- departure_best(testTB,timeName="time",indiType = "highBest")
# Differences from the best country for each year:
mySTB$res$raw_departures
# Sum of the cumulated differences for each country:
mySTB$res$cumulated_dif

# Departures from the best country according to the indicator lower is the best:
mySTB1 <- departure_best(testTB,timeName="time",indiType = "lowBest")

# Example 2
# Departures from the best country for the emp_20_64_MS Eurofound dataset:
mySTB2 <- departure_best(emp_20_64_MS,timeName="time",indiType = "highBest")
mySTB3 <- departure_best(emp_20_64_MS,timeName="time",indiType = "lowBest")


Run the code above in your browser using DataLab