Sunday, 15 January 2012

R - Execute a function in a file -



R - Execute a function in a file -

there r file , there function getinfo() in it. want run function in script file alone. possible ? know running script command on file , running function name help. run rest of stuffs script file dont want. best way out here

when utilize source on script file, code in file loaded r session active. code not in function, executed. see 2 options:

put function in seperate source file, or bundle if number of functions grows. set global r variable using option , retrieve value in file sourced using getoption, making execution of non-function code dependend on option. require set alternative before sourcing file, in project utilize in.

i go alternative 1.

r

No comments:

Post a Comment