Tag Archives: debug
Simple Debugging with R
Posted by Shawn Zhang
on July 15, 2012
No comments
Unlike other programming language such as Python and Java, R is less equipped with state of art level Integrated Development Environment. Thus, debugging program in R comes with a little trivial.
Perform "Assert"
in Python/C, Assert(test_expr) expression will throw out an exception if "test_expr" was false. In R , this feature can be implement with function "stopifnot()", let's demo this function via below example:
demo <- function (a){
stopifnot(a < 2000)
if (a < 2000){
Read more [...]