Suppose you have a large number of columns of a dataframe, and you want to plot each column – say a histogram for each column. This post shows some ways of achieving this. Let’s take the mtcars dataset as an example. data(mtcars) We will use the tidyverse approach: library(tidyverse) Way 1 mtcars %>% select_if(is_numeric) %>% map2(., names(.), ~ {ggplot(data = data_frame(.x), aes(x = .x)) + geom_histogram() + labs(x= .y)}) #> $mpg #> #> $cyl #> #> $disp #> #> $hp #> #> $drat #> #> $wt #> #> $qsec #> #> $vs #> #> $am #> #> $gear #> …