Histogram by groups

Hi

I'm trying to do a histogram in RStudio and Its coming up with the error "X must be numeric"

What does this mean and how can I fix my code so it works?

library(FSA)
op = par(oma=c(0,0,1.5,0), mar=c(3,3,2,1))
hist(Height ~ Gender,
las=1,
nrow=2, ncol=1,
cex.main=0.9, cex.lab=0.8, cex.axis=0.8,
mgp=c(1.8,0.6,0),
xlab="Height (cm)"
)
par(op)

Hi @JamesDick, the first argument to hist() function should be a vector, but your first argument is a formula -- do you know what table in the FSA packages contains a Height column?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.