Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

factors are nothing but enums and are used to shrink data and speed processing. Plus that matches what you typically want to happen in regressions: strings turn into (n-1) indicator variables. Otherwise, what is the meaning of using a string as an explanatory variable in a regression?

If you want to merge data frames that were created w/ different factors, perhaps the easiest thing to do is turn your factors into strings?

If d is your data frame, then:

d$factorVar <- as.character( d$factorVar )

merge your two data frames, then

merged$factorVar <- as.factor( merged$factorVar )

should set you right...

earl



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: