0

I have the next code:

ks.test(NA, "pnorm")

It throws an error. I have it inside the try function to allow that error (in fact, I do not have NA in such a code, but a changing data). I hoped that in an RMarkdown document, writing error=FALSE would not print the error not enough 'x' data but I have found that this is not the expected behaviour: https://bookdown.org/yihui/rmarkdown-cookbook/opts-error.html

Is there a way to not printing the error message?

Thank you!

iago
  • 2,990
  • 4
  • 21
  • 27
  • 2
    I'm not sure to understand. Did you try `try(ks.test(NA, "pnorm"), silent=TRUE)` ? (Related to https://stackoverflow.com/questions/19111956/suppress-error-message-in-r) – barboulotte Feb 01 '21 at 10:34
  • If you have it inside a `try` command, the error becomes a warning, so you can use the chunk option `warning = FALSE`. – Johannes Ranke Feb 11 '21 at 12:58

0 Answers0