func6 <- function(x){
tryCatch(stopifnot(is.numeric(x)), error=function(e){print("not numeric")})
tryCatch(stopifnot(is.finite(x)), error=function(e){print("not finite")})
tryCatch(stopifnot(length(x)!=0), error=function(e){print("has 0 length")})
tryCatch(stopifnot(!is.nan(x)), error=function(e){print("NA or NAN")})
tryCatch(stopifnot(!is.na(x)), error=function(e){print("NA or NAN")})
}
func6(2)
func6('a')
func6(Inf)
func6(c(1,2,3))
func6(NaN)
func6(NA)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.