mardi 21 février 2017

'Error: unexpected numeric constant' when using ifelse

Helo guys, I am trying to make 'mean.re74' a new variable that accounts all the mean values of the means for each member of the population, but when I enter this code I reciece this alert "Error: unexpected numeric constant in: " NA" "

any advice?
mean.re74 <- ifelse(lalonde$re74, (mean(lalonde$re74)+mean(lalonde$re75)+mean(lalonde$re78)) / 3

Aucun commentaire:

Enregistrer un commentaire