Plotting multiple different histograms based on vector of column names

Solution 1:

You can reshape the data and facet over the groups.

library(reshape2)
library(dplyr)

melt(df_hk_genes) %>% 
  ggplot(aes(x = value)) + 
  facet_wrap(~ variable, nrow = 5, scale = "free_x") +
  geom_histogram(bins=15)