error following cluster example
1
0
Entering edit mode
Claire Wilson ▴ 280
@claire-wilson-273
Last seen 10.2 years ago
> 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 it looks like you are tyring to select columns not rows, RawDataSub <- Raw.Data[,sub] #subsets on columns try: RawDataSub <- Raw.Data[sub,] #subset on rows hth claire -------------------------------------------------------- This email is confidential and intended solely for the use o...{{dropped}}
• 943 views
ADD COMMENT
0
Entering edit mode
rgentleman ★ 5.5k
@rgentleman-7725
Last seen 9.6 years ago
United States
On Tue, Nov 09, 2004 at 12:59:41PM +0100, kfbargad@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@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@jimmy.harvard.edu | +--------------------------------------------------------------------- ------+
ADD COMMENT

Login before adding your answer.

Traffic: 772 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6