Whether a function or series of calls results in error
Examples
# this should not produce error
# so the function result should be FALSE
has.error({
x = 8
y = number(10)
res = x + y
})
#> [1] FALSE
# this should produce the following error
# Error in x + y : non-numeric argument to binary operator
# so the function result should be TRUE
has.error({
x = 8
y = "random"
res = x + y
})
#> [1] TRUE
# this should result in error because
# the dataset does not contain a "rpkg.net" column
# the result should be TRUE
df1 = mtcars
has.error(df1[,"rpkg.net"])
#> [1] TRUE