View source: R/dev_mean_plot.R
dev_mean_plot | R Documentation |
Negative deviations and positive deviations are added over years and plotted by country.
dev_mean_plot( myTB, timeName = "time", time_0 = NA, time_t = NA, countries = c(NA, NA), indiType = "highBest", displace = 0.25, axis_name_y = "Countries", val_alpha = 0.95, debug = FALSE )
myTB |
a dataset time by countries |
timeName |
name of the variable representing time |
time_0 |
starting time |
time_t |
ending time |
countries |
selection of countries to display; NA means all countries |
indiType |
the type of indicator "highBest" or "lowBest" |
displace |
graphical displacement |
axis_name_y |
name of the axis |
val_alpha |
transparency value in (0,1]. |
debug |
a flag to get debug information as msg component |
a list with ggplot2 graphical object within res component
# 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.