> Dennis Fisher
> on Thu, 22 Feb 2018 13:01:37 -0800 writes:
> Luke
> Thanks — I revised the code to:
> ERRORMESSAGE <- try(source(USERSCRIPTFILE, local=T), silent=T)
> print(ERRORMESSAGE) now returns:
> $value
> [1] 0
> $visible
> [1] FALSE
> N
Please read ?try (again) carefully.In paticular note (under Value):
"The value of the expression if expr is evaluated without error, but an
invisible object of class "try-error"containing the error message, and the
error condition as the "condition" attribute, if it fails."
so:
attr(ERRORMESSAGE
Luke
Thanks — I revised the code to:
ERRORMESSAGE <- try(source(USERSCRIPTFILE, local=T), silent=T)
print(ERRORMESSAGE) now returns:
$value
[1] 0
$visible
[1] FALSE
Not clear what to make of that.
Dennis
Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (
Only the default error handler puts the error message in a buffer
where it can be retrieved with geterrmessage. try() replaces the
default error handler. Either look at the value returned by try() or
use tryCatch with conditionMessage.
Best,
luke
On Thu, 22 Feb 2018, Dennis Fisher wrote:
R 3.
R 3.4.3
OS X
Colleagues
I have a 20K line script in which I encounter an unexpected problem.
If the script detects presence of a particular file USERCODE.txt, it executes:
source(“USERCODE.txt”)
If that file is not present, the script executes without a problem.
There might be syntax er
5 matches
Mail list logo