Hrstart <- c(MNC$hrstart)
Hrstart
mean(Hrstart)
[1] NA
I wanted to get the mean of a variable (hrstart) but it keeps returning as NA.
CodePudding user response:
There will be NA
in your data. To get rid of them, use na.rm = TRUE
:
mean(Hrstart, na.rm = TRUE)