I want to check whether R command has error or not in iflese command. Similar to following one. I wonder how to accomplish this one. Actually I want to run the following code only if there is no error in the previous R code.
ifelse(
      test= Check R Command has error or not
    , yes = FALSE
    , no = TRUE
    )
ifelse(
      test= log("a") # Has error
    , yes = 3
    , no = 1
    )
 
     
    