Structure a multi-file program for proper RStudio debugger behavior

Hi. Newbie to the Forum, and relative newbie to R/RMarkdown/RStudio (but experienced programmer in multiple OO and Structured programming languages, e.g., Python, C/C++/C#, MatLab, et al.)

(Sorry for the long setting-of-context) So far, I've been using the source() method of structuring multi-file R programs, but, as an experienced programmer using both the OO and Structured/Procedural paradigms, I find this rather "distasteful." More specifically, I'm having trouble using the RStudio debugger--it doesn't stop at breakpoints I set in the source of the sourced files, and if I set a breakpoint before the call of a "sourced" function and step in, it enters an R or RStudio file (not certain which) instead of my file, and then if I use "step out," it proceeds back to the calling, i.e., top level file, not the sourced file containing the function I wanted to step into--and I suspect it's because of this "klugey" means of implementing multi-file program structure. (I did some Google research on how to implement a more "structured style" in multi-file R programs, but everything I found made it sound pretty complicated, i.e., that I have to use/master the packages approach, which seemed to involve an inordinate amount of both structural and learning "overhead" for this basic programming paradigm.)

So anyway, I have two "issues," which I suspect, but am not certain, are related (and I haven't been able to find satisfactory answers searching on my own):

  1. The debugger isn't stopping at breakpoints set in sourced files;

  2. I'd like to learn a more structured-style approach to architecting multi-file R programs.

Help, please. Thanks!

Is this considered off-topic, did I include too many questions--2--in one topic, was I too verbose, or does R/Studio not support the features I'm asking about?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.