I want to make plots of all variables with ggplot2
using map
function from purrr
. Everything is okay except x-axis label
. Any hint.
library(tidyverse)
Data <- esoph[ , 1:3]
fm1Plots <-
Data %>%
map(
~ ggplot(mapping = aes(x = .)) +
geom_bar(aes_string(fill = .)) +
labs(x = .)
)
fm1Plots[[1]]
fm1Plots[[2]]