# \donttest{
# Example 1: "lowBest" indicator type:
# Dataframe in the format time 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, 4.1,
2003, 1.3, 2.9, 4.0,
2004, 1.2, 3.1, 4.1,
2005, 1.2, 3.0, 4.0
)
mySTB <- sigma_conv(testTB)
resDM <- departure_mean(oriTB=testTB, sigmaTB=mySTB$res)
myG <- NULL
myG <- graph_departure(resDM$res$departures,
timeName = "time",
indiType = "lowBest",
displace = 0.25,
displaceh = 0.45,
dimeFontNum = 6,
myfont_scale = 1.35,
x_angle = 45,
axis_name_y = "Countries",
axis_name_x = "Time",
alpha_color = 0.9)
# Change the colour of rectangles:
myGG <- graph_departure(resDM$res$departures,
timeName = "time",
indiType = "lowBest",
displace = 0.25,
displaceh = 0.45,
dimeFontNum = 6,
myfont_scale = 1.35,
x_angle = 45,
color_rect = c("-1"='green4', "0"='yellow',"1"='red'),
axis_name_y = "Countries",
axis_name_x = "Time",
alpha_color = 0.9)
# Example 2: "highBest" type of indicator:
# Graphical plot of sigma convergence for the emp_20_64_MS Eurofound dataset:
data(emp_20_64_MS)
mySC <- sigma_conv(emp_20_64_MS)
resDMeur <- departure_mean(oriTB = emp_20_64_MS, sigmaTB = mySC$res)
myG1 <- NULL
myG1 <- graph_departure(resDMeur$res$departures,
timeName = "time",
indiType = "highBest",
displace = 0.25,
displaceh = 0.45,
dimeFontNum = 6,
myfont_scale = 1.35,
x_angle = 45,
axis_name_y = "Countries",
axis_name_x = "Time",
alpha_color = 0.9)
# Plot mean departures for selected countries only and change the colour of rectangles:
myG2 <- NULL
myG2 <- graph_departure(resDMeur$res$departures[,1:8],
timeName = "time",
indiType = "highBest",
displace = 0.25,
displaceh = 0.45,
dimeFontNum = 6,
myfont_scale = 1.35,
x_angle = 45,
color_rect = c("-1"='red', "0"='yellow',"1"='green4'),
axis_name_y = "Countries",
axis_name_x = "Time",
alpha_color = 0.9)
# }
Run the code above in your browser using DataLab