I want to get data by using my GetRemoteData-Function. Sometimes data isn't available, an Error occurs and R stops running my code. In that case I want to use a tryCatch to go on. My code lookes like this:
If a function is to return a value, that value should be the last thing before exiting the function, your error function assigned a matrix to a variable 'matrix' but then didnt return it. Naming it, doesnt seem worthwhile so better code might be