I have a simple function that will create a histogram of the passed variable, but I want for the function to name the histogram plot "Histogram of X" where X is the name of the variable.
I also want it to name the X-Axis the name of the variable as well.
How can I do this?
Here is the function currently, but not giving the correct labels I want:
plot.histogram <- function (x){
hist(x, main = "Histogram of x", xlab = "x")
}
Thanks