5 ms·
Why would you want to implement such a thing in R and not use a decent programming language. I'm an heavy R user myself but I'd never use R for anything but sta
by stewbrew 9y ago
Why would you want to implement such a thing in R and not use a decent programming language. I'm an heavy R user myself but I'd never use R for anything but statistics, for which it is ok.
- hhmc 9y agoOne would assume familiarity of language to the author.
- closed 9y agoalso, maybe the people they interact with tend to use R, so writing it in that language might give more immediate traction / feedback.
- stewbrew 9y agoI think one nevertheless should warn people not to use R for things it's not suited for. Building a reliable app or library is one of those things. R provides excellent means to call into C, C++, Java etc. People should use one of these instead for such things.
- Bootvis 9y agoWhy is R not decent? The performance could be better but what else?
- stewbrew 9y agoIt's an excellent language for interactive data analysis but it totally sucks as a programming language, easily surpassing PHP and JavaScript in this respect.
- Bootvis 9y agoI program R daily (admittedly mainly for statistics) but I don't feel this pain at all. To me, R feels like a more sane JavaScript. Are you missing type safety or better OOP?
- stewbrew 9y agoJust check whether a variable is a string. There are many options for various flavours of OOP. IMHO it's the very foundation as an array/vector oriented language that's wrong.
- kirillseva 9y agoNot wrong, just not what you're used to. Oh, and not to mention the `1`-based indexing! Such heresy! R excels at two things: statistical packages and generating reports/papers (the rmarkdown ecosystem is simply fantastic at this). If either of those two things are the key features of your product it makes sense to use R for the rest of the glue code. I write R daily and I'm very productive with the language (having built a small ecosystem of tools to aid me with the mundane stuff). If you're willing to give R a chance I highly recommend you check out syberia.io - it's a framework like rails/django for creating statistical models in R and packaging them into API containers.
- stewbrew 9y agoI have given R a chance for 12 years or so.
- Bootvis 9y agoThanks for the response. I personally have used too much MATLAB to bothered by the array/vector orientation.
- phillc73 9y agoYou're right in the sense that there is no fundamental difference between character and string type in R. A "string" is just a character variable which contains more than one letter. variable_name <- "This is a string" # These all tell you the class type str(variable_name) class(variable_name) typeof(variable_name) # Is variable character type? Boolean TRUE/FALSE is.character(variable_name) # This tells you the number of characters. > 1 is a string. nchar(variable_name) # With vector this time variable_char_vector <- c("String A", "String B") # How long? length(variable_char_vector) # What types? str(variable_char_vector) # Are they strings? nchar(variable_char_vector) I'm not an expert in a wide range of programming languages, but this doesn't seem to be a major shortcoming in R.
- zzleeper 9y agoYou can probably do it quite easily with Pandoc if you know Haskell, or with Pandoc + a panflute filter if you know Python.