[BioC] error following cluster example

Robert Gentleman rgentlem at jimmy.harvard.edu
Tue Nov 9 14:07:59 CET 2004


On Tue, Nov 09, 2004 at 12:59:41PM +0100, kfbargad at lg.ehu.es wrote:
> Dear Users,
> 
> I am following the example on Lab 5: Cluster analysis (June 2003) with 
> my own data.
> 
> I have filtered my expression set as shown on the example and I get 
> the following
> 
> > sub <- genefilter(X,ffun)
> > sum(sub)
> [1] 1124
> 
> I save this subset of genes and then log transform it. But when I type 
> the next command I get the following error:
> > X <- X[sub,]
> > X <- log2(X)
> > RawDataSub <- Raw.Data[,sub]
> Error in Raw.Data[, sub] : (subscript) logical subscript too long
> 
> Why do I get this error?? 

  Perhaps because the dimensions of X and of Raw.Data are not the
  same? If you are not familiar with R you should spend some time with
  introductory material to learn about the language as that knowledge
  is essential for debugging.

> Also, if I have stored the subset expression data as X, why is Raw.Data
> [,sub] using [,sub] again? I don´t really understand this step, if 
> anyone could explain its purpose.
> 

  Because X and Raw.Data are not the same object. R basically has pass
  by value semantics and so (almost) everything is a copy. 

> I´m running R 1.9.1 on an XP computer
> 
> Thanks a lot for your help
> 
> David
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor

-- 
+---------------------------------------------------------------------------+
| Robert Gentleman                 phone : (617) 632-5250                   |
| Associate Professor              fax:   (617)  632-2444                   |
| Department of Biostatistics      office: M1B20                            |
| Harvard School of Public Health  email: rgentlem at jimmy.harvard.edu        |
+---------------------------------------------------------------------------+



More information about the Bioconductor mailing list