Chris_Rands Chris_Rands - 2 months ago 6
R Question

R equivalent of Python 'pass' statement

Python has a

statement, a null operation, which can be a useful placeholder before code is complete, for example in Python:

def example_function():
# stuff to do here

Is there an equivalent in R? Thank you.


Just have an empty function body:

foo = function(){

You should probably also add a comment, and a warning maybe?

foo = function(){
# write this tomorrow
 warning("You ran foo and I havent written it yet")

Same thing with an if expression:

  # do this bit later
  message("x isnt 1")