I was wondering what the best approach is for returning messages generated on the server side to the client side. I know that it is possible to test a condition on the server side, and if the condition fails, return a message. Instead I would like to capture messages generated by non-DS functions on the server side and return these. An example is for the lmer function with the verbose=TRUE option. This prints out the state of convergence at each iteration on the console. The question is how to return this to the client side.
So far the best I can do is to do:
out <- capture.output(try(result <- lmer(formula = BMI ~ trtGrp + Male + (1|idSurgery), data = dtPatient, verbose=TRUE)))
In this example, you still get the lmer object in ‘result’, but you also get the intermediate messages in ‘out’.
Does anyone know of a better way of doing this? I have searched existing functions for a way to do this and don’t think there is another way…