Update SOanswer.R

Sorry, my testing on the last pull request was a little shoddy.  I've now fixed behaviour for warnings and errors.