Check out example codes for "not displaying prints and on.exit in r". It will help you in understanding the concepts better.

Code Example 1

quiet <- function(x) { 
  sink(tempfile()) 
  on.exit(sink()) 
  invisible(force(x)) 
}

Learn ReactJs, React Native from akashmittal.com