I am looking for a way to capture standard error and redirect it to standard output in R (Shiny). I can not find any information any where in the web. Is there a way to do this?
closed as off-topic by N0rbert, muru, waltinator, Eliah Kagan, Zanna Apr 12 '18 at 21:21
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This is not about Ubuntu. Questions about other Linux distributions can be asked on Unix & Linux, those about Windows on Super User, those about Apple products on Ask Different and generic programming questions on Stack Overflow." – N0rbert, muru, waltinator, Zanna
This code works. trueFalse and errorMessage are captured by the server by calling the function that produces that code and displayed by using renderText() in the server and textOutput() in the GUI
trueFalse = FALSE # capture all the output to a file. FILE <- file("log.txt", open = "wt") sink(FILE) sink(FILE, type = "message") #try(log("a")) try(message("Path does not exist. You can make changes to the PARAMS file. Afterwards, stop and restart glycoPipe")) ## revert output back to the console -- only then access the file! sink(type = "message") sink() #file.show("log.txt") errorMessage <- (readLines("log.txt"))