I am trying to get histograms of all columns of a data frame isNumVal using sapply. Codes below:
sapply(isNumVal, plotHist)
plotHist <- function(df){
df <- tbl_df(df)
print(
ggplot(df, aes(x = df[1])) + geom_histogram()
)
}
The x axis label in all the plots is showing df1.
How do i get it show the name of the columns?