Chris_Rands Chris_Rands - 1 year ago 90
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.

Answer Source

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")
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download