Good day R-community,

i just wondered if it is a bug or a feature...

When i have a matrix "mat" with one column and i delete the last row with

mat <- mat[-nrow(mat),] the result is a list.

So my next call mat[10,] will throw an "wrong dimension" error.
The proper call must be:

mat <- as.matrix(mat[-nrow(mat),])

So is this desired behavior or a bug?

I use R-version 2.15.3, but reconstructed this behavior in 3.2.0 as well.

greetings

-- 
 *Joscha Zander*

Roche Diagnostics GmbH
DXRDDD..6164
Sandhofer Strasse 116
68305 Mannheim / Germany

mailto:joscha.zan...@roche.com <joscha.zan...@roche.com>

 *Roche Diagnostics GmbH*
Sandhofer Straße 116; D‑68305 Mannheim; Telefon +49‑621‑759‑0;
Telefax +49‑621‑759‑2890
Sitz der Gesellschaft: Mannheim - Registergericht: AG Mannheim HRB 3962 -
Geschäftsführung: Dr. Ursula Redeker, Sprecherin; Edgar Vieth -
Aufsichtsratsvorsitzender: Dr. Severin Schwan

 *Confidentiality Note*
This message is intended only for the use of the named recipient(s) and may
contain confidential and/or privileged information. If you are not the
intended recipient, please contact the sender and delete the message. Any
unauthorized use of the information contained in this message is prohibited.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to