Argument is not numeric or logical: returning NA ---R

r

#1

Hi ,

I am new to R and having little hard time while learning R.

I am trying to get a mean of age and i am getting error “argument is not numeric or logical: returning NA” while its giving mean through summary command. Can anyone let me know why it is coming.
class of age column is integer. Does mean not work with integers.

Values of Age : 6
18
16
14
5
11
8
11
15
11
19
17
12
10
10
13
15
8


#2

@psra19 first check the class of ‘age’. If it is character or factor, then convert it to numeric.


#3

Hi ,

Thanks for your reply but class is integer and its not factor.


#4

Hi @psra19,

Share the code line that shows the error. Also, check the datatype of the age columns and make sure you have no missing values in the columns.