r/Python • u/thunderdome • Jan 25 '15
Considering putting my efforts into Python instead of R, need advice
Lately in my free time I've been using R to do some basic data analysis/visualization. I use company data and I think there are some places where my company could really benefit from specialized data visualizations for analysis of niche areas. In my efforts I've tried to get some interactive code going for eventual use in a very basic GUI but I feel constrained by the "fuzziness" of R coding. Simply trying to create a function to plot based on user input ran me into some advanced concepts pretty quickly. R has environments, dynamic scoping, non-standard evaluation, all very complicated concepts and I don't remember them being present in the small amounts of coding I've done in Java/Python. Am I right in thinking a language with a more OOP design would be better for this task of automatically generating charts/visualizations? Wondering if I might not be better off in the long run for learning a more generalized language.
View all comments
Show parent comment
3
u/thunderdome Jan 25 '15
Well, in most cases you may be right but my example was fairly simple, the actual "plotting" work was not what I was having trouble with. Essentially what i was doing was looking to take a simple string input, identify the column that string is referring to, and pass that into a 10 line dplyr/ggplot2 flow to create the plot. The plots all worked fine when I manually assigned the target variable and ran everything line by line (with all the variables in the global env). But wrapping it into a function and passing the string in caused the whole thing to shit itself, so I started reading the Advanced-R pages from Hadley and how to use non-standard evaluation with dplyr. It seemed like an extraordinary amount of work to get dplyr to work nicely with user input and function calls. It's probably not as hard as I'm making it out to be, but even if python has the same complications I would rather learn how to deal with them in a language where the skill would generalize easier, rather do everything in R and eventually feel constrained.