[R] Missing Values in Logical Expressions

G.Maubach at weinwolf.de G.Maubach at weinwolf.de
Tue Apr 26 10:09:57 CEST 2016


Hi All,

I need to evaluate missing values in my data. I am able to filter these 
values and do simple statistics on it. But I do need new variables based 
on variables with missing values in my dataset:

Check_Kunde_2011 <- ifelse(is.na(Umsatz_2011) == TRUE & Kunde_2011 == 1, 
1, 0)
Check_Kunde_2011 <- factor(Check_Kunde_2011, levels = c(1,0), labels = 
c("Check", "OK"))

The new variable is not correctly created. It contains no values:

table(Check_Kunde_2011)
< table of extent 0 >

I searched the web but could not find a solution.

How can I work with variables and missing values in logical expressions?

Where could I find something about this?

Kind regards

Georg



More information about the R-help mailing list