Hello,
I have a data frame. I generated some dummies using a simple loop.
However, I can't concatenate the dummies to the original data frame.
The last line in this code is obviously wrong, but I haven't found a similar task on my web searches.
Thanks for your time and interest
I have a data frame. I generated some dummies using a simple loop.
However, I can't concatenate the dummies to the original data frame.
Code:
yyy=max(region)
for (i in 1:yyy) {
nam=paste("region",i,sep="")
assign(nam,as.numeric(cise>0 & region==i))
data=cbind(data,paste("region",i,sep="" ))
}
Thanks for your time and interest