I have a column in a dataframe and I am trying to find the mean. I used:
mean(dat$Age, na.rm=TRUE)
and got an error that the numeric or logical operator wrong. Realizing there was a non numeric value, I fixed it using:
dat[10, 2] #- value in Age column on row 10
I tried it again and still got the numeric error.
Edit: I need to define the function as a new variable.