if (FALSE) {
# Example 1
# A dataset 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
)
# Plot the deviations from the mean for all countries:
resDMP <- dev_mean_plot(testTB,
timeName="time",
displace = 0.25,
axis_name_y = "Countries")
resDMP
# Plot by considering only some of the years:
resDMP1 <- dev_mean_plot(testTB,
timeName="time",
time_0 = 2002,
time_t = 2004,
displace = 0.25,
axis_name_y = "Countries")
resDMP1
# Example 2
# The Eurofound dataset "emp_20_64_MS":
myTB1 <- emp_20_64_MS
# Plot the deviations from the mean only for some of the member states:
resDMP2 <- dev_mean_plot(myTB1,
timeName="time",
time_0 = 2005,
time_t = 2010,
countries= c("AT","BE","IT"),
displace = 0.25,
axis_name_y = "Countries")
resDMP2
}
Run the code above in your browser using DataLab