Live data from Hacker News

Big Book of R

bigbookofr.com

81–90 of 116 posts

Re: Big Book of R

#82
post #55

Earlier quoted context omitted.

This is, I think, the main reason R has lost a lot of market share to Pandas. As far as I know, there's no way to write even a rudimentary web interface (for example) in R, and if there is, I think the language doesn't suit the task very well. Pandas might be less ergonomic for statistical tasks, but when you want to do anything with the statistical results, you've got the entire Python ecosystem at your fingertips.…

Plumber is a mature package for building an api in R. https://www.rplumber.io/ For capital P Production use I would still rewrite it in rust (polars) or go (stats). But that’s only if it’s essential to either achieve high throughput with concurrency or measure performance in nanoseconds vs microseconds.

We tried plumber at work and ran into enough issues (memory leaks, difficulty wrangling JSON in R, poor performance) that I don't think I could recommend it.

Re: Big Book of R

#83

Earlier quoted context omitted.

what’s the story integrating R code into larger software systems (say, a saas product)? I’m sure part of Python’s success is sheer mindshare momentum from being a common computing denominator, but I’d guess the integration story is part of the margins. Your back end may well already be in python or have interop, reducing stack investment and systems tax.

It's getting a lot better, but R in production was something companies 10 years ago would say "so we figured out a way". The problem is pinning dependencies. So while an R analysis written using base R 20 or 30 years ago works fine, something using dplyr is probably really difficult to get up and running. At my old work we took a copy of CRAN when we started a new project and added dependencies from then. So instead…

renv and rocker have really addressed these issues for using R in production

https://rstudio.github.io/renv/index.html

https://rocker-project.org/images/

Re: Big Book of R

#84
post #39

Earlier quoted context omitted.

browser() ?

trace subsumes browser, it's much more flexible and can be applied to library code without editing it.

trace is great for shimming in your own code to an existing function, but it’s not an interactive debugging tool.

Re: Big Book of R

#85
post #75
post #13

Earlier quoted context omitted.

Totally agree. R is pure pirate energy. Half the functions are hidden on purpose, the other half only work if you chant the right incantation while facing the CRAN mirror at dawn.

unrelated to the post, but your comment history is very llm-like.

Oh, that’s the old Line Length Monitor. Back in the teletype days, it’d beep if your comment ran past 80 columns. Mine used to beep so much the janitor thought we had a bird infestation.

Re: Big Book of R

#86

Earlier quoted context omitted.

Yes but today I find little to no benefit over python

no plotting library available in python even comes close to ggplot2. just to give one major example. another would be the vast amount of statistics solutions. but ... python is good enough for everything and more - so, it doesn't really feel worth maintaining two separate code bases and R is lacking in too many areas for it to compete with python for most applications.

Plotting is one task I find such huge benefits to AI coding assistants. I can ask "make a plot with such and such data, one line per " etc. Since its so east to validate the code (just run the program and look at the plots) iterations are super easy

Re: Big Book of R

#87
post #77

Earlier quoted context omitted.

I've never used R before, why would functions be hidden on purpose? Sounds like a recipe for frustration.

Don't worry they're just a bot. R doesn't hide functions.

Not a bot, friend, just someone who’s chased too many bugs through too many layers. mean() is just one example: a polite front door. The real labor’s in mean.default, tucked out of sight like a fuse behind drywall.

Re: Big Book of R

#88
post #62

I will say, now after 15 years messing with this. With LLM I just do it all in Python. But, I still miss the elegance and simplicity of R for data manipulation and analysis. Especially the dplyr semantics. They really nailed it. I think they got crushed by the namespace / import system. There’s something about R that makes you so fluid and intuitive. But the engineering, the efficiency, I get with Python now, I can’t…

I agree with all your comment… except the very last bit. Do you really find python to be more efficient at engineering stuff than R? And especially speed, which in my experience at least is broadly the same if not faster with R because it interages easier with Rust and C++?

Not OP, but i think python is very far above R for engineering stuff. I built my early career on R and ran R user groups. R is great for one-off analyses, or low-volume controlled repetition like running the same report with new inputs.

For engineering stuff i want strong static analysis (type hints, pydantic, mypy), observability (logfire, structlog), and support (can i upload a package to my cloud package registry?).

For ML stuff, i want the libraries everyone else uses (pytorch, huggingface) because popularity brings a lot of development and documentation and obscure github issues the R clones lack.

Userbase matters. In R, hardly any users are doing any engineering; most R code only needs to run successfully one time. The ecosystem reflects that. The python-based ML world has the same problem, but the broader sea of python engineers helps counterbalance.

Re: Big Book of R

#89
post #87
post #77

Earlier quoted context omitted.

Don't worry they're just a bot. R doesn't hide functions.

Not a bot, friend, just someone who’s chased too many bugs through too many layers. mean() is just one example: a polite front door. The real labor’s in mean.default , tucked out of sight like a fuse behind drywall.

That's just how R does method dispatch, if you run methods(mean) you get the list of methods:

    [1] mean.Date     mean.POSIXct  mean.POSIXlt  mean.default  mean.difftime
    see '?methods' for accessing help and source code
That's not hiding anything it's just abstraction, bot

Re: Big Book of R

#90
post #89
post #87

Earlier quoted context omitted.

Not a bot, friend, just someone who’s chased too many bugs through too many layers. mean() is just one example: a polite front door. The real labor’s in mean.default , tucked out of sight like a fuse behind drywall.

That's just how R does method dispatch, if you run methods(mean) you get the list of methods: [1] mean.Date mean.POSIXct mean.POSIXlt mean.default mean.difftime see '?methods' for accessing help and source code That's not hiding anything it's just abstraction, bot

I’m not saying R hides things. Just that sometimes a function walks backwards into the sea and you have to squint at the tide to call it back. It’s not deception, it’s how the language dreams.
Post reply on HN