I am trying to create a column ID based on logical statements for values of other columns. For example, in the following dataframe
ID
test <- st
So, I hear this works:
Data$X1<-as.character(Data$X1) Data$GEOID<-as.character(Data$BLKIDFP00) Data<-within(Data,X1<-ifelse(is.na(Data$X1),GEOID,Data$X2))
But I admit I have only intermittent luck with it.