Error with NA missing values

Hi everyone, I am running a code to count NA values in data but it is coming again and again zero only though the data has NA values. Please help me in this regard.
df <- Data
df
x <- df[1:15, 1]
x
is.na(x)

Console -
x
[1] "41" "36" "12" "18" "NA" "28" "23" "19" "8" "NA"

is.na(x)
[1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE

"NA" is a string. Your data does not show any NA values.

Hey, could you please suggest something on it. Thanks

(ints <- as.integer(c("41", "36", "12" ,"18", "NA", "28", "23","19", "8", "NA")))

# omit na from ints, 
# get a list of all the nas that were omitted
# see how long that list is
length(na.action(na.omit(ints)))

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.