I have 16 variables/columns, and I'm trying to make a histogram for all of them at once to explore normality. The variables are all numeric which I have confirmed in R. However with my code below it gives me the above error.
The hist() function plots a numeric vector not a data frame. You can use the unlist() function to make a vector from the data frame. The code below shows that plotting a data frame causes the error but that unlist() fixes the problem.
DAR <- data.frame(X=rnorm(20),Y=rnorm(20),Z=rnorm(20))
hist(DAR[,c("X","Y","Z")])
#> Error in hist.default(DAR[, c("X", "Y", "Z")]): 'x' must be numeric
hist(unlist(DAR[,c("X","Y","Z")]))