Created
July 16, 2012 04:06
Explode a columns properties into new columns with a binary value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Nice for then doing aggregate functions | |
for(t in unique(df$colToExplode)) { | |
a[paste("",t,sep="")] <- ifelse(df$colToExplode==t,1,0) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment