Home > Mobile >  The mean of a variable keeps coming back as NA
The mean of a variable keeps coming back as NA

Time:12-14

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)
  • Related