[R] filter matrix

AlessandroSemeria@cramont.it AlessandroSemeria at cramont.it
Fri Dec 13 09:12:03 CET 2002


Hello dear R-list!
I have an alphanumeric matrix (mymat) like this one:

   (Embedded image moved to file: pic06334.pcx)
with 13000 rows (5 columns), I want to extract from it a submatrix following a citeria:
col(5)<0.01.
I tried with :

> sub.mymat <-  mymat[as.numeric(mymat[,5])<0.01,]    # "as.numeric " because elements are quoted!

but this give a bad result (I filtered mymat with two different spreadsheet obtaining a result
very diffrent from that obtained with previous R-line).
Some suggestion?

Thanks in advance!
A.S.

----------------------------

|------------------------------------+------------------------------------|
|Alessandro Semeria                  |Tel. +39 544 536811                 |
|------------------------------------+------------------------------------|
|Models and Simulation Laboratory    |Fax. +39 544 538663                 |
|------------------------------------+------------------------------------|
|The Environment Research Center -   |                                    |
|Montecatini (Edison Group),    Via  |                                    |
|Ciro Menotti 48,                    |E-mail: asemeria at cramont.it         |
|48023 Marina di Ravenna (RA), Italy |                                    |
|------------------------------------+------------------------------------|


-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic06334.pcx
Type: application/octet-stream
Size: 128 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20021213/d35d9c48/pic06334.obj


More information about the R-help mailing list