Hi everyone,
When dealing with errors, sometimes I want to run a bunch of code when an error
occurs.
For now I usually use a structure such as:
res <- tryCatch(expr, error = function(cond) cond) # or try(expr)
if (inherits(res, “error”)) # or inherits(res, “try-error”)
# a bunch of code
I th
Emil, thanks for very nice explanation. Wish base drop would have same
behavior as abind::adrop.
чт, 22 нояб. 2018 г., 17:47 Emil Bode emil.b...@dans.knaw.nl:
> The problem is that the drop is only applied (or not) after the
> subsetting, so what R does is:
> - Getting the subset, which means a 1
Le 22/11/2018 à 14:47, Emil Bode a écrit :
The problem is that the drop is only applied (or not) after the subsetting, so
what R does is:
- Getting the subset, which means a 1 x 1 matrix.
- Only then It either returns that as is (when drop=FALSE), or removes ALL
dimensions of extent 1, regardle
The problem is that the drop is only applied (or not) after the subsetting, so
what R does is:
- Getting the subset, which means a 1 x 1 matrix.
- Only then It either returns that as is (when drop=FALSE), or removes ALL
dimensions of extent 1, regardless of whether these are rows or columns (or