[Rd] [tryExcept] New try Function

2018-11-22 Thread Ernest Benedito
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

Re: [Rd] Subsetting row in single column matrix drops names in resulting vector

2018-11-22 Thread Dmitriy Selivanov
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

Re: [Rd] Subsetting row in single column matrix drops names in resulting vector

2018-11-22 Thread Serguei Sokol
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

Re: [Rd] Subsetting row in single column matrix drops names in resulting vector

2018-11-22 Thread Emil Bode
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