Currently I run R scripts the following way:
R --slave < <script_fullname> argument1 argument2 ...
I was wondering the best practices in R on how to exit the script with a warning, would q() just do it?
if(!file.exists(argument1)){
q()
}
print to the stdout
if(!file.exists(argument1)){
print('file does not exist')
q()
}
and print to the std err?
Also, I see the following warning everytime I run R scripts this way. When reading the stdout I see:
ARGUMENT 'argument1' __ignored__
ARGUMENT 'argument2' __ignored__
Is there anyway to avoid such warnings?