←back to thread

Big Book of R

(www.bigbookofr.com)
288 points sebg | 7 comments | | HN request time: 0.432s | source | bottom
Show context
cye131 ◴[] No.43649039[source]
R especially dplyr/tidyverse is so underrated. Working in ML engineering, I see a lot of my coworkers suffering through pandas (or occasionally polars or even base Python without dataframes) to do basic analytics or debugging, it takes eons and gets complex so quickly that only the most rudimentary checks get done. Anyone working in data-adjacent engineering work would benefit from R/dplyr in their toolkit.
replies(6): >>43649143 #>>43649208 #>>43649881 #>>43650319 #>>43650677 #>>43683325 #
1. kasperset ◴[] No.43649143[source]
I love R and dplyr. It is very readable and easy to explain to non-programmers. I use it almost everyday. Not exactly on the topic,I am having difficulties debugging it. May be I need to brush up on debugging R. Not sure if there is a easy way to add breakpoint when using vscode.
replies(2): >>43649189 #>>43651350 #
2. JackeJR ◴[] No.43649189[source]
browser() ?
replies(1): >>43651046 #
3. disgruntledphd2 ◴[] No.43651046[source]
trace subsumes browser, it's much more flexible and can be applied to library code without editing it.
replies(2): >>43653795 #>>43657274 #
4. itsmevictor ◴[] No.43651350[source]
Have you checked this extension? https://marketplace.visualstudio.com/items?itemName=RDebugge...
5. tylermw ◴[] No.43653795{3}[source]
trace is great for shimming in your own code to an existing function, but it’s not an interactive debugging tool.
replies(1): >>43655610 #
6. disgruntledphd2 ◴[] No.43655610{4}[source]
It sure is. If you set the second argument to browser you can step through any function.
7. wdkrnls ◴[] No.43657274{3}[source]
Is there a way to trace an attribute to a function? I couldn't find one, but curious if it exists. I seemed blocked by the fact that trace seemed to expect a name as a character string. Some functions in base R have functions in their attributes which modify their behavior (e.g. selfStart). I ended up just copying the whole code locally and then naming it, but for a better interactive experience I really wish there was a way to pass a function object as I can with debug.