Live data from Hacker News

One Year with R

github.com

231–240 of 266 posts

Re: One Year with R

#231
post #61

R, and by R I mean R+tidyverse, is the world's best graphing calculator attached to an OK scheme. To which I mean R is a highly optimized, well-oiled machine if you're using it for its highly-optimized, well-oiled purposes. I tend to have notebooks full of tiny fragments like this dat_min %>% group_by(ymd = make_date(year(date), month(date), day(date))) %>% summarize(vol_btc=sum(vol_btc), vol_usdt=sum(vol_usdt), trad…

> best graphing calculator attached to an OK scheme. I discovered "How To Design Programs" somewhere late in my first year of using R. Like most beginning R coders with nominal experience in other languages, I wrote a lot of monolithic scripts in a very imperative style. HtDP gave me a mental framework for decomposing larger problems into bite-sized chunks. The lispy roots of R lent itself particularly well to the mo…

I really don’t think this is that different from how a lot of us learned to code though. I learned by writing html and PHP specifically to solve a problem of having a website. The only difference I see is that the average CS student has to write reliable and working code as their career, while quants and statisticians tend to think that code is just a means to the end. Both are right I’d say depending on the problem.

Re: One Year with R

#232
post #47
post #23

The common trope with R is that statisticians and love it and developers hate it. The the main reason that statisticians love it is that the libraries useful to them are much better in R than elsewhere (though Python keeps encroaching in that turf, and "real developers" dislike Python a lot less than they do R). The main reasons that developers hate it is that it is very unlike almost all other languages that they're…

> it doesn't help that almost nobody learned R as their first computer (as opposed to statistics) language. Aside from two statisticians I had as professors, I am yet to meet someone with deep understanding of statistics who doesn't speak R as first language ... I found it way easier to grasp the meaning of statistics by playing with R than by reading the maths.

You’re right, but I’d would think in recent years most stats people would have python as their first language. It probably comes preinstalled on their OS at this point (not sure if this applies to windows outside of WSL yet.)

Re: One Year with R

#233

Earlier quoted context omitted.

I use Vim with the R command line wrapped around Makefiles. I don't even have RStudio installed. Works great. I can even pop up an interactive R command prompt session and do whatever I want in it, even quick ggplot2 graphs. Help shows up just as you would expect, and plots pop up in new windows. RStudio is much less advanced than people think it is, it's really just managing R's windows for you and doing generic IDE…

Do you have notes or documentation on how to get this working without RStudio? Preferably on a Macbook?

I use Linux, but it should be pretty straightforward on Mac as well. Just type "R" in the command prompt and check the manpage for R itself ("man R").

I'd also look into the "knitr" package, which is what all of the Rmarkdown is based around. So for instance, most of my Makefiles are based around a simple command like:

    R -e "library(knitr); knit2html('index.Rmd')"
Then I just code using VIM on index.Rmd. You can probably set this up however you like with the R command line.

For interactive it literally is just typing "R" in the command prompt. For help, things like "?ggplot", "??knitr", or whatever, so you can open multiple interactive sessions like you were using IPython or something. When you print a plot, it just pops up in a new window.

You can also use "R" to just execute R raw if you are trying to do it without Rmarkdown. I just prefer the HTML output. Pretty sure all the RStudio RMarkdown stuff just calls knitr as well.

The output looks the same as anything on RPubs (and there is a way to publish to RPubs, I used to have to do that at one point), random one from the first page:

https://rpubs.com/mnguy1019/881028

Re: One Year with R

#234
post #159
post #101

Earlier quoted context omitted.

Ha ha, I love that this is your only comment here! Thanks for all your work on R. I came here with sleeves rolled up to defend the language, but was pleasantly surprised to find it was already being done much better than I could have. It's interesting to see how R elicits such a reaction to some programmers. I think it's frequently misunderstood, and R needs to be used in a particular way to allow it to fly. When I'v…

Have you seen https://dtplyr.tidyverse.org ? It gives you the syntax of dtplyr and (almost all of) the speed of data.table.

Oh, I feel a bit silly now! I'd seen a couple of attempts to combine the two, but didn't realise this one was official. It looks great. I have an analysis coming up that borders between dplyr and data.table in terms of size, so will check it out then!

Re: One Year with R

#235
post #227
post #221

Earlier quoted context omitted.

Any chance of sharing which tool(s)? I know some people who're involved in making the haskell ecosystem a better place for less mainstream users and I'm pretty sure they'd want to know more about this. (and if it turns out they already know, -I- don't, and that sounds pretty cool and fun to read up on :)

Sure! It’s the department of archaeogenetics at the Max Planck Institute for Evolutionary Anthropology https://poseidon-framework.github.io/#/

Much appreciated, passed on in the hopes it's useful, and when it's not 0030 and I'm awake enough to actually understand any of it I'll be having a read through myself.

Cheers!

Re: One Year with R

#236
post #235
post #227

Earlier quoted context omitted.

Sure! It’s the department of archaeogenetics at the Max Planck Institute for Evolutionary Anthropology https://poseidon-framework.github.io/#/

Much appreciated, passed on in the hopes it's useful, and when it's not 0030 and I'm awake enough to actually understand any of it I'll be having a read through myself. Cheers!

I’m a total noob but offered my development skills in trade of archaeological domain knowledge, so just getting familiar with the code base myself atm :) if you/your friends wanted any sort of intro to the team I could arrange that as I’m in a slack channel with some of them!

Fwiw, it’s mostly a tool for parsing and processing this ‘Jan no’ data schema https://poseidon-framework.github.io/#/janno_details

Re: One Year with R

#237

Earlier quoted context omitted.

Is there a tutorial someplace that explains how ggplot actually manages plotting? Or the architecture and layers between the high level code and how a plot is drawn? Meaning, I love being able to express what I want and ggplot figures out a good plot for me. But I know there are many layers that can be manipulated, but I just don’t understand the layers. One of the best compliments I can think of is that with ggplot,…

That should be covered in the original A layered grammar of graphics paper: https://vita.had.co.nz/papers/layered-grammar.html And then there is an entire ggplot2 book (there are many, but this one was written by Hadley): https://ggplot2-book.org/

That's very helpful. I think this chapter was what I was looking for:

https://ggplot2-book.org/internals.html

Re: One Year with R

#238

I've written an interpreter for R (a subset; it was for school and I left out some features like S4 and the condition system) so I have done some pretty deep dive into the language reference and GNU R source. I agree with the author's sentiment - I love a lot of what R has, but there is a lot of small madnesses. There are so many unique PL ideas in R (may not actually be unique but certainly unique among common langu…

Is the subset R interpreter you wrote available on the net?

Sorry for getting back to you so late; I'd rather not link my github here as I'd rather remain as anonymous as possible on public forums

Re: One Year with R

#239
post #60

Earlier quoted context omitted.

> almost as bad as typical Python docs I found numpy, scipy, pandas, and plotly docs to be quite clear and extensive. The only docs I have found to be confusing are matplotlib's and the Python standard library's. Not sure what packages you are referring to?

On the other hand, I'm curious what you've found to be lacking about the standard library documentation. I've found it to be generally very thorough, in some cases fantastic, though there's an occasional weak point.

For me, the stdlib docs isn't lacking in material, but it is hard to navigate. I think that is partly because it mixes different types of documentations together (tutorial, reference, and changelog). They should split each module's docs into two pages: a tutorial with examples of the most common use-case of the module, and a reference listing all of the classes, methods, etc. of the module.

Also, the built-in types are documented in one page, going from boolean to sequence types and even type annotations. Every Ctrl + F gives me 20 different results, which is annoying as hell.

Re: One Year with R

#240

Earlier quoted context omitted.

There is an better alternate universe where xlisp-stat doesn't fall behind and S doesn't happen.

Interestingly, there appears to be an attempted reboot: https://lisp-stat.dev/ My first reaction, is "why not on a modern Scheme as opposed to Common Lisp" and in so thinking, I have demonstrated exactly why no lisp / scheme has ever achieved critical mass :-)

Shocking. I still using the xlisp-stat based social simulation book first edition (20+ years ago). The move to ... does not fit my mind. I do not know there is a re-start!!!
Post reply on HN