If I have a facet grid with 1 row and 2 columns, they are each the same width and height. How do I reduce the size of the right facet so that the left is more dominant?
This is my current illustration:
library(tidyverse)
#create some data
set.seed(20181022)
data <- data.frame(x = letters[ceiling(runif(100, 0, 10))],y = runif(100),stringsAsFactors = FALSE)
#duplicate the data and add an indicator for the Plot Type
data <- data %>%
bind_rows(data) %>%
mutate(PlotType = rep(c('a','b'), each = nrow(data)))
#Facet by the plot type and subset each geom (I have made some changes)
data %>%
ggplot(aes(x, y)) +
facet_grid(.~PlotType, scales = "free")+
geom_boxplot(data = filter(data, PlotType == 'a')) +
geom_bar(data = filter(data, PlotType == 'b'), stat = "identity")+
coord_flip()