I have two columns in a data.frame. lets say one is called "before" and the other is "after". each of these 2 factors has 5 levels (very satisfied, satisfied, somehow, dissatisfied, very dissatisfied).
This is the data:
dat <- structure(list(before = structure(c(2L, 5L, 5L, 1L, 3L, 3L), .Label = c("very satisfied",
"satisfied", "somehow", "dissatisfied", "very dissatisfied"), class = "factor"),
after = structure(c(3L, 3L, 5L, 2L, 2L, 2L), .Label = c("very satisfied",
"satisfied", "somehow", "dissatisfied", "very dissatisfied"
), class = "factor")), row.names = c(NA, -6L), class = c("tbl_df",
"tbl", "data.frame"))
How to build a side by side by plot so that for each of those 5 levels, there are 2 bars (before and after) side by side represented?