From zhuang at moho.ess.ucla.edu  Mon Jul 17 01:57:33 2006
From: zhuang at moho.ess.ucla.edu (zhuang at moho.ess.ucla.edu)
Date: Mon, 17 Jul 2006 01:57:33 +0200 (CEST)
Subject: [Rd] subsetting a matrix by conditions (PR#9082)
Message-ID: <20060716235733.342F154B45@slim.kubism.ku.dk>

Full_Name: Jiancang Zhuang
Version: 2.3.0
OS: Windows XP, BSD, Linux
Submission from: (NULL) (130.195.2.100)


> a<-matrix(scan(), ncol=3, byrow=T)
1: 6 NA 4 
4: 5 3 6
7: 8 2 9 
10: 3 6 NA
13: 
Read 12 items
> a
     [,1] [,2] [,3]
[1,]    6   NA    4
[2,]    5    3    6
[3,]    8    2    9
[4,]    3    6   NA
> a[a[,2]>2,]
     [,1] [,2] [,3]
[1,]   NA   NA   NA
[2,]    5    3    6
[3,]    3    6   NA

We may hope the first row of A removed or keep the same. However, R keeps the
first row and changes all the value in that row into NA.



[Rd] subsetting a matrix by conditions (PR#9082)
zhuang at moho.ess.ucla.edu