Re: [R] difference between script and a function....

2022-12-24 Thread akshay kulkarni
Dear Ivan, Thanks a lot.! Thanking you, Yours sincerely, AKSHAY M KULKARNI From: Ivan Krylov Sent: Saturday, December 24, 2022 9:27 PM To: akshay kulkarni Cc: R help Mailing list Subject: Re: [R] difference between script and a function

Re: [R] difference between script and a function....

2022-12-24 Thread Ivan Krylov
On Sat, 24 Dec 2022 15:47:14 + akshay kulkarni wrote: > How do you debug if there is an error, particularly if I run the > script from the BASH prompt? Post-mortem debugging for non-interactive R scripts can be enabled by setting options(error = quote(dump.frames("A_SUITABLE_FILE_NAME", to.

Re: [R] difference between script and a function....

2022-12-24 Thread akshay kulkarni
from the Linux prompt? Thanking you, Yours sincerely, AKSHAY M KULKARNI From: Ivan Krylov Sent: Saturday, December 24, 2022 8:52 PM To: akshay kulkarni Cc: R help Mailing list Subject: Re: [R] difference between script and a function On Sat, 24 Dec 2022 14:54

Re: [R] difference between script and a function....

2022-12-24 Thread Ivan Krylov
On Sat, 24 Dec 2022 14:54:52 + akshay kulkarni wrote: > If there is some error in the script, the error will be output to > the stdout? Or to the file that it creates for saving the output of > the script? When using Rscript: to stderr, to be precise. When using R CMD BATCH: to the Rout fi

Re: [R] difference between script and a function....

2022-12-24 Thread akshay kulkarni
From: Andrew Simmons Sent: Saturday, December 24, 2022 8:18 PM To: akshay kulkarni Cc: R help Mailing list Subject: Re: [R] difference between script and a function 1. The execution environment for a script is the global environment. Each R script run from a shell will be

Re: [R] difference between script and a function....

2022-12-24 Thread Andrew Simmons
1. The execution environment for a script is the global environment. Each R script run from a shell will be given its own global environment. Each R session has exactly one global environment, but you can have several active R sessions. 2. Using return in a script instead of a function will throw

[R] difference between script and a function....

2022-12-24 Thread akshay kulkarni
Dear members, I will be running scripts automatically in RHEL with crontab. I want to know the differences between running a script and a function. in particular: 1. An execution environment will be created for the function. what about a script? Is the execution