HI, Dear R community,

I try to create 100 dummy variables like the following:

ack$id_1 <- (ack$ID==1)*1
ack$id_2 <- (ack$ID==2)*1
..
.
ack$id_100 <- (ack$ID==100)*1


I used the following codes:

for(i in 1:100){
              ack$id_[i] <- (ack$ID==i)*1
                     }

But only one column is created, can anyone help me?

Thanks a lot!


-- 
Sincerely,
Changbin
--

	[[alternative HTML version deleted]]

