I'm using this function to get some exploratory analysis in r
nums <- sapply(db, is.numeric)
sapply(db[,nums], function(x) {
nome <- as.character(names(x))
hist(x)
lines(density(x, na.rm = T))
})
How can i print the name of the column in the plot as x axis? I've tried with apply over matrix by column - any way to get column name? but I can't figure out the second part of the function to make it work in this case