What Are Productive Ways to Debug Rcpp Compiled Code Loaded in R (On Os X Mavericks)

Why cpp diagnostics and code completion stopped working in RStudio?

If you execute .rs.setClangDiagnostics(2) from the R console before you interact w/ C++ you should see some detailed error messages in the console indicating what the source of the problem might be. I am a bit out of practice interpreting these diagnostics but @kevin-ushey or someone else on the RStudio team should be able to take it from there.

Standard functions in R like substr is debugged which I am not interested

It seems like you are stepping into each function, usually by having used the s command. Using the n command within debug mode should run each nested function without stepping into the function. Note that if you use s once, every run command (usually just clicking enter) will use s until another command is used.

R also has some more intricate tools for debugging. In Hadley's free online book Advanced R there is a great chapter about debugging in R (Chapter 22). For more in-depth knowledge about debugging in R, i can highly recommend this chapter.



Related Topics



Leave a reply



Submit