5 ms·
Mother of all clickbait titles. I read the first few pages and didn't see any content about R. The first chapter is an introduction to scheme. I scanned it and
by groceryheist 8y ago
Mother of all clickbait titles.
I read the first few pages and didn't see any content about R. The first chapter is an introduction to scheme. I scanned it and didn't see any R code all. It's an introduction to scheme that builds up to K means.
R does suck in so many ways, especially the object oriented systems and the horrible default libraries with so many inconsistent idioms, but we put up with it because mainly because it provides the most advanced open source ecosystem for modeling and visualizing data and it is also pretty fast, especially with data.table. If being fast is important we have Julia as a competitor. If having a better designed language with a reasonably complete ecosystem and sometimes being slower is OK we have python. Like pretty much every other domain area, there just isn't a competitive niche in data science for a lisp.
Also, R is already pretty functional and Lisp-like, sure it doesn't have prefix syntax, but it does have first class functions. Using various types of map (lapply, apply &c) is practically mandatory after a certain point.
I love the Wizard Book too, but this is embarrassing.
- chairmanwow 8y agoThanks for saving me a click.
- discardable_dan 8y agoMy main beef with R is that this is valid code: > f <- function (n) { + f <- 1 + if (n == 0) return(f) else n * f(n-1)} > f(5) [1] 120 The language has some warts, that's for sure.
- hatmatrix 8y agoIsn't that just lisp-2-like behavior where functions and data maintain separate identities?
- kgwgk 8y agoNo, if you set f <- 42 between the moment where you define f as a function and the moment where you call it then it doesn't work anymore: > f(5) Error in f(5) : could not find function "f"
- Tarq0n 8y agoFunctions having their own environment is actually pretty useful once you get your head around them.
- naiveai 8y agoFirst class functions does not a functional language make.