[BioC] extracting a column as a vector.

James W. MacDonald jmacdon at uw.edu
Thu Nov 8 15:02:04 CET 2012


Hi Priya,

On 11/8/2012 3:25 AM, priya [guest] wrote:
> I have a matrix in the following way :
>
> probes p1 p2 p3 p4 p5
>
> 244971 5  6  7  8  9
> 244972 8  7  9  7  8
> 244973 4  3  2  6  7
> 244973 8  5  3  6  8
>
>   I would like to extract only the probe names and tried this:
>   degtl - original matrix( containing 22810 entries)
>
>
> ids<- degtl[,1]
>
> and I got
> head(ids)
> [1] 244941_at   244959_s_at 244974_at   245009_at   245024_at   245028_at
> 22810 Levels: 244901_at 244902_at 244903_at 244904_at 244905_at 244906_at 244907_at 244908_at ... AFFX-TrpnX-M_at.
>
> I would like to extract the probe names as a vector in  the following form :

Right. Well, this doesn't have anything to do with Bioconductor, and in 
fact is a very rudimentary thing to do in R. So I wouldn't even suggest 
asking on R-help. Although you could try, if you are up for a bit of 
public shaming.

Anyway you seem to be lacking very basic knowledge and asking 
rudimentary questions on a listserv is probably the least efficient way 
to learn things. Instead, may I suggest you do some reading? If you ever 
expect to go far with R (or any endeavor you might consider, now that I 
think about it) you will do well to figure out how to help yourself.

If I were you, I would read 'An Introduction to R' 
http://cran.r-project.org/doc/manuals/R-intro.html. This goes over the 
basic data structures in R and shows how to manipulate them.

Best,

Jim


>
> ids<- c("244971","244972","244973",......) for all 22810 levels.Iam unable to do it and always end up with a list.
>
>
>
>   -- output of sessionInfo():
>
> R version 2.15
> Linux
>
> --
> Sent via the guest posting facility at bioconductor.org.
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor

-- 
James W. MacDonald, M.S.
Biostatistician
University of Washington
Environmental and Occupational Health Sciences
4225 Roosevelt Way NE, # 100
Seattle WA 98105-6099



More information about the Bioconductor mailing list