Re: [R] which question

From: Eleni Christodoulou <elenichri_at_gmail.com>
Date: Fri, 06 Jun 2008 17:29:26 +0300

An example is:

symbol=human[which(human[,3] %in% genes.sam.names),8]

The data* human* and *genes.sam.names* are attached. The result of the above command is:
> symbol

 [1] CCL18                  MARCO                  SYT13
 [4] FOXC1                  CDH3
 [7] CA12                   CELSR1                 NM_018440

[10] MICROTUBULE-ASSOCIATED NM_015529 ESR1
[13] PHGDH GABRP LGMN
[16] MMP9 BMP7 KLF5
[19] RIPK2 GATA3 NM_032023
[22] TRIM2 CCND1 MMP12
[25] LDHB AF493978 SOD2
[28] SOD2 SOD2 NME5
[31] STC2 RBP1 ROPN1
[34] RDH10 KRTHB1 SLPI
[37] BBOX1 FOXA1 NM_005669
[40] MCCC2 CHI3L1 GSTM3
[43] LPIN1 DSC2 FADS2
[46] ELF5 CYP1B1 LMO4
[49] AL035297 NM_152398 AB018342
[52] PIK3R1 NFKBIE MLZE
[55] NFIB NM_052997 NM_006023
[58] CPB1 CXCL13 CBR3
[61] NM_017527 FABP7 DACH
[64] IFI27 ACOX2 CXCL11
[67] UGP2 CLDN4 M12740
[70] IGKC IGKC CLECSF12
[73] AY069977 HOXB2 SOX11
[76] NM_017422 TLR2
[79] CKS1B BC017946 APOBEC3B
[82] HLA-DRB1 HLA-DQB1
[85] CCL13 C4orf7
[88] NM_173552
21345 Levels: (2 (32 (55.11 (AIB-1) (ALU (CAK1) (CAP4) (CASPASE ... ZYX

As you can see, apart from gene symbols, which is the required thing, RefSeq ID sare also retrieved...

Thanks a lot,
Eleni

On Fri, Jun 6, 2008 at 1:23 PM, Dieter Menne <dieter.menne_at_menne-biomed.de> wrote:

> Eleni Christodoulou <elenichri <at> gmail.com> writes:
>
> > I was trying to select a column of a data frame using the *which*
> command. I
> > was actually selecting the rows of the data frame using *which, *and then
> > displayed a certain column of it. The command that I was using is:
> > sequence=*mydata*[*which*(human[,3] %in% genes.sam.names),*9*]
> ....
> Please provide a running example. The *mydata* are difficult to read.
>
>
> Dieter
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> 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.
>

	[[alternative HTML version deleted]]

______________________________________________
R-help_at_r-project.org mailing list
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. Received on Fri 06 Jun 2008 - 14:39:15 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 06 Jun 2008 - 17:30:38 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive