On Thu, Mar 13, 2014 at 11:51 AM, Olivier ETERRADOSSI <olivier.eterrado...@mines-ales.fr> wrote: > Thank you Sarah, > > But no, I was not expecting this. For me integer(0) is not 0. > That's why I finally tested length(unused.rows), which is 0 when > unused.rows is integer(0).
Also from ?"[" i, j, ...: indices specifying elements to extract or replace. Indices are 'numeric' or 'character' vectors or empty (missing) or 'NULL'. Numeric values are coerced to integer as by 'as.integer' (and hence truncated towards zero). Character vectors will be matched to the 'names' of the object (or for matrices/arrays, the 'dimnames'): see 'Character indices' below for further details. So yes, in this case 0 is treated as integer(0). When you have problems that seem odd to you, carefully reading the relevant help is always a good place to start. Sarah ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.