3 ms·
Data frames in R give you the relational model with a Turing complete language. I think of it as a better SQL, at least for analytics (as opposed to transactio
by chubot 8y ago
Data frames in R give you the relational model with a Turing complete language. I think of it as a better SQL, at least for analytics (as opposed to transaction processing).
Besides its data structures, R is surprisingly similar to JavaScript -- it's has Scheme-like semantics but C-like syntax.
For certain problems, it's a pleasure to program in. You don't have to go through "objects" to get to your tables; you just have tables!
The examples here might give you a flavor:
https://cran.r-project.org/web/packages/dplyr/vignettes/dplyr.html https://cran.r-project.org/web/packages/dplyr/vignettes/dply...
R itself has a lot of flaws, but the tidyverse [1] is collection of packages that provide a more consistent interface.
FWIW I agree that more mainstream languages should have tables natively. It is an odd omission. Somehow they got coupled to storage, but they're also useful for computation.
[1] https://www.tidyverse.org/ https://www.tidyverse.org/
- api 8y agoYes, but I'm thinking of a general purpose language like Go that would be used to implement normal things. R is specialized for data analysis. Most "normal things" have designs that are deeply inefficient and compromised by bad under-powered data models.
- chubot 8y agoI'm not suggesting that people actually write business applications in R -- I'm just saying it's probably the closest thing to what you're asking for. And I agree that what you want should exist -- R is proof that it's perfectly possible and natural! Although, people are using (abusing) R to write web apps: https://shiny.rstudio.com/ https://shiny.rstudio.com/ They mostly display data, but they have non-trivial interaction done in the style of JS.