10 times the basics...) ;-)
O.
-Message d'origine-
De : Sarah Goslee [mailto:sarah.gos...@gmail.com]
Envoyé : jeudi 13 mars 2014 16:59
À : Olivier ETERRADOSSI
Cc : r-help
Objet : Re: [R] behaviour of rows and colomns suppression in a matrix
On Thu, Mar 13, 2014 at 11:51 AM, Olivier ET
ector instead of NOT with a logical.
Olivier
-Message d'origine-
De : arun [mailto:smartpink...@yahoo.com]
Envoyé : jeudi 13 mars 2014 16:13
À : r-help@r-project.org
Cc : Olivier ETERRADOSSI
Objet : Re: [R] behaviour of rows and colomns suppression in a matrix
Hi,
You could use:
TM2[!ma
On Thu, Mar 13, 2014 at 11:51 AM, Olivier ETERRADOSSI
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
14 16:12
À : Olivier ETERRADOSSI
Cc : r-help
Objet : Re: [R] behaviour of rows and colomns suppression in a matrix
Hi,
Your basic problem seems to be that you expect R to take
TM2[0, ]
as meaning not to subset anything, rather than to take only row 0, which
doesn't exist:
R> TM2[0,]
Hi,
You could use:
TM2[!margin.Rows <=thresh,!margin.Cols <=thresh]
# [,1] [,2]
#[1,] 1 1
#[2,] 1 1
#[3,] 1 1
#For the first case:
TM1[!margin.Rows <=thresh,!margin.Cols <=thresh]
# [,1] [,2]
#[1,] 1 1
#[2,] 1 1
A.K.
On Thursday, March 13, 2014 10:02
Hi,
Your basic problem seems to be that you expect R to take
TM2[0, ]
as meaning not to subset anything, rather than to take only row 0,
which doesn't exist:
R> TM2[0,]
[,1] [,2] [,3]
There's a hint in
?"["
which says:
An index value of 'NULL' is treated as if it were
Hi List,
while running a script on a set of matrices I came into a case I would not
have guessed to arrive.
Below is a small toy example to illustrate the case.
Of course there is a simple workaround (using a simple test), but why does
this occur, and shouldnt it be corrected ?
More probably I
7 matches
Mail list logo