News for hackers. Stuff that matters.
Re:Big Book of R by kasperset on Thursday April 10, 2025 @08:06PM (#43649143)
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.
Re:Big Book of R by JackeJR on Thursday April 10, 2025 @08:16PM (#43649189)
browser() ?
Re:Big Book of R by disgruntledphd2 on Friday April 11, 2025 @02:30AM (#43651046)
trace subsumes browser, it's much more flexible and can be applied to library code without editing it.
Re:Big Book of R by tylermw on Friday April 11, 2025 @09:52AM (#43653795)
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 by disgruntledphd2 on Friday April 11, 2025 @12:25PM (#43655610)
It sure is. If you set the second argument to browser you can step through any function.
Re:Big Book of R by wdkrnls on Friday April 11, 2025 @03:01PM (#43657274)
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.
Re:Big Book of R by itsmevictor on Friday April 11, 2025 @03:31AM (#43651350)