The 'error' argument to tryCatch must be a function (of one argument,
the exception). Its return value will be the return value of tryCatch
if there is an error. Hence you should change the present
error = return(TBAPrice)
to
error = function(exception) TBAPrice
You can use
error = f
All,
I have a function that I would like to return 0 or NA on unit root error but I
cannot figure out how to get tryCatch to work. I have followed the examples in
the R documentation as well as some online but I am missing something. If I
added the tryCatch code I only get the error value.
2 matches
Mail list logo