Re: [R] matrix subset problem with factors

2019-02-20 Thread Jeff Newmiller
With on official weight, I second the opinion that the existing behavior is appropriate and not a bug. Functions should not "unexpectedly" return factors... a common example are the read.table family of functions that by default return factors, but the behaviour is deterministic and controllabl

Re: [R] matrix subset problem with factors

2019-02-20 Thread Marc Schwartz via R-help
Hi, I get the same behavior in R 3.5.2 on macOS. Others may feel differently, but I am not so sure that this is a bug, as opposed to perhaps the need to clarify in ?Extract, that the following, which is found under Atomic vectors: "The index object i can be numeric, logical, character or empty

[R] matrix subset problem with factors

2019-02-20 Thread ऋषि / rIsHi
Hi All, I like to report this bug related to matrix subset by rownames when passed as factors. Now factors are may not be safe to use but then it should generate a warning message. Since many time we use values returned by some packages as factor to subset a matrix and which may result in a wrong