3 ms·
One of R's big benefits is the huge amount of statistical functionality, for example numerous different quantilization algorithms. If you are working with a lo
by wesm 18y ago
One of R's big benefits is the huge amount of statistical functionality, for example numerous different quantilization algorithms.
If you are working with a lot of heterogeneous data in R it becomes a real headache. Merging data frames seems like it should work like you think it should but if one of your sets of keys (strings) are 'factors' (what I am calling 'legacy S+ functionality', I'm sure they're useful for many algorithms), you'll end up with garbage. There's a hack you can put in your code ('options(stringsAsFactors=FALSE)') which alleviates some of this but in general aligning data I found to be a huge pain. If you're running regressions this is pretty important
haven't tried sage but have heard good things. NumPy is a good alternative because it's extremely well implemented and has consistent behavior across the board. Extensibility (with Fortran, Cython/Pyrex, C/C++) is clean and easy. Never thought I'd write Fortran 77 code being born quite a few years after '77 but it's an easy way to speed up simple procedural algorithms 50x or more.
- earl 18y agofactors 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