Is there an R equivalent of the pythonic "if __name__ == "__main__": main()" ?
Posted
by gappy
on Stack Overflow
See other posts from Stack Overflow
or by gappy
Published on 2010-06-03T17:13:20Z
Indexed on
2010/06/03
17:14 UTC
Read the original article
Hit count: 174
The title says it all. The objective is to have two simple ways to source some code, say func.R, containing a function. Calling R CMD BATCH func.R
initializes the function and evaluates is. Within a session, issuing source("func.R")
simply initializes the function.
Any idea?
© Stack Overflow or respective owner