Skip to content
Prev 310212 / 398503 Next

conditional coding question

Hello,

Try the following.


incorp <- rep(NA, 4408)
incorp[groupinc == 5] <- 'cons'
incorp[(groupinc == -3:-2) & (indinc < 9)] <- 'ethnat'
incorp[(groupinc == 1:4) & (indinc > 8)] <- 'libmul'
incorp[(groupinc == -2:-1) & (indinc > 8)] <- 'civic'


Hope this helps,

Rui Barradas
Em 07-11-2012 23:07, haps escreveu: