Re: [R] How to remove some rows from a data.frame

2007-12-24 Thread affy snp
-2003M2226856749400 . On Dec 24, 2007 3:54 AM, Moshe Olshansky [EMAIL PROTECTED] wrote: To answer your firs question try M[-which( M$s1 == 0 M$s2 == 0),] For the second question, you must start with the more precise definition of the grouping criterion. --- affy snp

Re: [R] How to remove some rows from a data.frame

2007-12-24 Thread affy snp
) { cbind.data.frame(chr=unique(x$chr), Start=min(x$pos), End=max(x$pos), Rows=nrow(x), Pattern=paste((, x$s1, x$s2, )) ) } do.call(rbind, lapply(lapply(split(df, paste(df$s1, df$s2)), f), unique)) On 24/12/2007, affy snp

[R] How to remove some rows from a data.frame

2007-12-23 Thread affy snp
Hello list, I have a data frame M like: BAC chrpos s1 s2 RP11-80G24177465510-10 RP11-198H14178696291-10 RP11-267M21179681704-10 RP11-89A19 180950808-10 RP11-6B16182255496-10

[R] how to threshold a matrix

2007-12-15 Thread affy snp
Dear list, I have a matrix M (2500 rows and 9 columns). It looks like 2.2 0.1 2.63.6 .. 0.4 1.9 2.74.2.. 1.8 2.5 4.32.2... . If I want to do: (1) if M[i,j]=0.3, M[i,j]=1 (2) if M[i,j]=-0.3, M[i,j]=-1 (3) Otherwise, M[i,j]=0

Re: [R] hclust in heatmap.2

2007-12-06 Thread affy snp
:20 PM, affy snp [EMAIL PROTECTED] wrote: Dear list, I am using heatmap.2(x) to draw a heatmap. Ideally, I want to the matrix x clustered only by columns and keep the original order of rows unchanged. Is there a way to do that in heatmap.2()? Thanks a lot! Any suggestions

Re: [R] hclust in heatmap.2

2007-12-06 Thread affy snp
Thanks James! Allen On Dec 6, 2007 9:21 AM, James W. MacDonald [EMAIL PROTECTED] wrote: affy snp wrote: Dear list, I am using heatmap.2(x) to draw a heatmap. Ideally, I want to the matrix x clustered only by columns and keep the original order of rows unchanged. Is there a way

[R] row lables in heatmap.2()

2007-12-06 Thread affy snp
Dear list, I am wondering if there are any parameters in heatmap.2 to be able to adjust the size of row labels. Or the size of the plot can be made smaller. The plot I got is big and cannot see the full row labels completely. And what is the maximum of rows which could allow row labels visible

Re: [R] about col in heatmap.2

2007-11-30 Thread affy snp
, 2007 5:09 PM, affy snp [EMAIL PROTECTED] wrote: Hi list, My data set is comprised of 47 columns and about 700 rows. Most of the values would be around 2, while some will go beyond in either direction, higher or lower. Is there a way to specify the parameter of col or others if necessary

Re: [R] about col in heatmap.2

2007-11-30 Thread affy snp
30, 2007 7:58 PM, affy snp [EMAIL PROTECTED] wrote: Hi Jim, Thanks but I imagine the transformed data would not actually represent the pattern from the original data. Is there other alternatives? Ideally, I would like to have the color bar looking like the one in http

[R] about col in heatmap.2

2007-11-30 Thread affy snp
Hi list, My data set is comprised of 47 columns and about 700 rows. Most of the values would be around 2, while some will go beyond in either direction, higher or lower. Is there a way to specify the parameter of col or others if necessary to have the range of representing colors be 08, and

[R] How to manipulate a data frame

2007-11-29 Thread affy snp
Dear list, I have a data frame like: log2.ratios[1:3,1:4] Clone a1 a2 a3 1 GS1-232B23 -0.0207500 0.17553833 0.21939333 2 RP11-82D16 -0.1896667 0.02645167 -0.03112333 3 RP11-62M23 -0.1761700 0.08214500 -0.04877000 how to make it to

Re: [R] how to read in a txt file with some blanks

2007-11-29 Thread affy snp
the blanks with commas and that might do it for you. This would mean that 1 2 (which would be two variables where there are 2 blanks) would now be 1,,2 which would be three variables. So you need to define what is supposed to happen in these cases. On Nov 28, 2007 8:21 PM, affy snp [EMAIL

Re: [R] How to manipulate a data frame

2007-11-29 Thread affy snp
Thanks a lot, Petr. Allen On Nov 29, 2007 12:12 PM, Petr PIKAL [EMAIL PROTECTED] wrote: Hi I just guess what you want but maybe rownames(log2.ratios) -log2ratios$Clone changes rownames and then you could get your output (after getting rid of first column). If you just want an output to

[R] How to take the ave of two rows in a data frame

2007-11-29 Thread affy snp
Dear list, I have a data frame like: log2.ratios[1:3,1:4] ID a1 a2 a3 1 GS1-232B23 -0.0207500 0.17553833 0.21939333 2 RP11-82D16 -0.1896667 0.02645167 -0.03112333 3 RP11-62M23 -0.1761700 0.08214500 -0.04877000 4

[R] Heatmap or Heatmap.2---hclust

2007-11-28 Thread affy snp
Hi list, I used heatmap() and heatmap.2() to draw the dendrogram and got error messages for both. They were: heatmap(as.matrix(y3),col=rainbow(256),scale = column);dev.off(); Error in hclustfun(distfun(x)) : NA/NaN/Inf in foreign function call (arg 11) Does anybody know how to correct this? I

[R] how to read in a txt file with some blanks

2007-11-28 Thread affy snp
Hi list, Is there a way to read in a txt file with some blanks? The ideal way could be to replace blanks with NAs. Thanks a lot! Allen [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] how to read in a txt file with some blanks

2007-11-28 Thread affy snp
: If the data is fixed field, then read.fwf. Else blanks are normally allowed delimiters. How do you want to interprete blanks? There are number of ways, none of which you have specified. On Nov 28, 2007 6:46 PM, affy snp [EMAIL PROTECTED] wrote: Hi list, Is there a way to read in a txt file

Re: [R] Heatmap problem

2007-11-22 Thread affy snp
Hi Jim, The problem with color2D.matplot is that it cannot do dendrogram which I want. Thanks! Allen On 11/22/07, Jim Lemon [EMAIL PROTECTED] wrote: affy snp wrote: Hi friends, I used heatmap(as.matrix(y2),col=rainbow(256),scale = column) to generate the heatmap. But it did

Re: [R] Heatmap problem

2007-11-22 Thread affy snp
:[EMAIL PROTECTED] Namens Jim Lemon Verzonden: donderdag 22 november 2007 11:21 Aan: affy snp CC: r-help@r-project.org Onderwerp: Re: [R] Heatmap problem affy snp wrote: Hi friends, I used heatmap(as.matrix(y2),col=rainbow(256),scale = column) to generate the heatmap. But it did not show

[R] Heatmap problem

2007-11-21 Thread affy snp
Hi friends, I used heatmap(as.matrix(y2),col=rainbow(256),scale = column) to generate the heatmap. But it did not show the code that which color correspond the value. Is there any parameter for this in heatmap()? Thanks a lot! Allen [[alternative HTML version deleted]]

[R] how to sort a data.frame by ascending some columns

2007-11-18 Thread affy snp
Dear list, I have a data frame (238304 rows and 6 columns). I want the data frame sorted by two columns in ascending order. I am showing the first 5 rows of the data frame clones.info[1:5,1:6] USER_CLONE_ID CHROMOSOME Expr1002 KB_POSITION Allele_A WELL_ID 1 SNP_A-1855402 17 41419603

Re: [R] how to sort a data.frame by ascending some columns

2007-11-18 Thread affy snp
: clones.info[order(clones.info$CHROMOSOME),] -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O On 18/11/2007, affy snp [EMAIL PROTECTED] wrote: Dear list, I have a data frame (238304 rows and 6 columns). I want the data frame sorted by two columns

Re: [R] how to sort a data.frame by ascending some columns

2007-11-18 Thread affy snp
132913 1 792 [2,] 149264 178012 1 817 [3,] 237378 142083 1 819 [4,] 149002 130012 1 832 On 11/18/07, affy snp [EMAIL PROTECTED] wrote: Thanks all of you. It works. Have a good weekend! Allen On 11/18/07, Benilton Carvalho [EMAIL PROTECTED] wrote: actually, clones.info[order

Re: [R] About print a label in plot

2007-11-16 Thread affy snp
arguments, and which one you are using depends on what kind of object is 'Disease.FL'. If you don't know the class of the object, you can do this: class(Disease.FL) Julian affy snp wrote: Dear list, Hello! I have a question about how to print a label in the plot. I am using the following

[R] Plot problem

2007-11-15 Thread affy snp
Dear list, I have a question about using plot(). I tried the code: pdf(mel_chr_all_13cancer_cghFLasso_all.pdf, height=6, width=11);plot( Disease.FL, index=1:4, type=All);dev.off(); and it went through well which outputed 4 plots for 4 samples in one page. But if I increase the numbers of

[R] How to get row numbers of a subset of rows

2007-11-14 Thread affy snp
Hello list, I read in a txt file using B-read.table(file=data.snp,header=TRUE,row.names=NULL) by specifying the row.names=NULL so that the rows are numbered. Below is an example after how the table looks like using B[1:10,1:3] SNPChromosome PhysicalPosition 1

Re: [R] How to get row numbers of a subset of rows

2007-11-14 Thread affy snp
be the first time.) Bert Gunter Genentech Nonclinical Statistics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of jim holtman Sent: Wednesday, November 14, 2007 8:39 AM To: affy snp Cc: r-help@r-project.org Subject: Re: [R] How to get

[R] About print a label in plot

2007-11-14 Thread affy snp
Dear list, Hello! I have a question about how to print a label in the plot. I am using the following code: pdf(mel4_chr3_11cancer_cghFLasso.pdf, height=6, width=5);plot(Disease.FL, index=i, type=Single,main=Plot of Labels);dev.off(); But Plot of Labels has not been printed. Any suggestions?

Re: [R] How to get row numbers of a subset of rows

2007-11-14 Thread affy snp
Thank you very much, Julian. I got it. Best, Allen On Nov 14, 2007 2:38 PM, Julian Burgos [EMAIL PROTECTED] wrote: One way to do this is range(which(B[,2]==1)) Julian affy snp wrote: Hello list, I read in a txt file using B-read.table(file=data.snp,header=TRUE,row.names

Re: [R] How to pool a group of samples and take the ave.

2007-11-12 Thread affy snp
:37 PM, affy snp [EMAIL PROTECTED] wrote: Dear list, Hi! I have a table A, 238304 rows and 243 columns (representing samples). First of all, I would like to pool a group of samples from 48th column to 243rd column and take the average across them and make a single column,saying

Re: [R] How to pool a group of samples and take the ave.

2007-11-12 Thread affy snp
Thanks Jim and Ben. Allen On Nov 12, 2007 3:43 PM, Benilton Carvalho [EMAIL PROTECTED] wrote: it's defined in Biobase. On Nov 12, 2007, at 3:30 PM, affy snp wrote: Thanks Jim. It is way simple. Great. Is there any function like rowMedians() which could take the median value across

Re: [R] How to more efficently read in a big matrix

2007-11-11 Thread affy snp
, statement, bind.data) : RS-DBI driver: (error in statement: unrecognized token: 2SignalA) What can you suggest? Sth wrong with the input file you can think of? Thanks! Allen On Nov 10, 2007 10:37 AM, Gabor Grothendieck [EMAIL PROTECTED] wrote: Thanks. On Nov 10, 2007 10:29 AM, affy snp

[R] how to emerge two tables by taking the ave.

2007-11-11 Thread affy snp
Dear list, I am new to R and very inexperienced. Sorry for the trouble. I have two txt files and want to merge them by taking the average. More specifically, for example, the txt file1, with row names and column names, consists of 238000 rows and 196 columns. Each column corresponds to a sample.

Re: [R] how to emerge two tables by taking the ave.

2007-11-11 Thread affy snp
on the last line of the file. Also what does 'str' of x and y show? It appears that one is a data frame and one is a matrix. That might be causing some of the problems. On Nov 11, 2007 10:30 PM, affy snp [EMAIL PROTECTED] wrote: Hi Jim, Thanks a lot! I am wondering why I ended up

Re: [R] how to emerge two tables by taking the ave.

2007-11-11 Thread affy snp
] [,2] [,3] [1,] 2.045 [2,] 1.52 NA [3,] 2.542 On Nov 11, 2007 10:47 PM, affy snp [EMAIL PROTECTED] wrote: Hi,Jim. I created two txt files as: x.txt id b1 b2 b3 a1 246 a2 12 NA a3 46 NA y.txt idb1 b2 b3 a1 NA4

[R] How to log-2 transform a matrix

2007-11-10 Thread affy snp
Dear list, I am wondering how to log-2 based transform a matrix with numeric values? I tried CGHlog2-log2(CGH) but got an error. Then I found for log2(x) in R, the x has to be a numeric or complex vector. Any method for a matrix? Thanks a lot and have a good weekend! Allen Error in

Re: [R] How to more efficently read in a big matrix

2007-11-10 Thread affy snp
they are), so you will need GBs of RAM, and preferably a 64-bit OS. Otherwise you would be better off using a DBMS to store the data (see the Manual mentioned in my first para). On Fri, 9 Nov 2007, affy snp wrote: Dear list, I need to read in a big table with 487 columns and 238,305 rows

Re: [R] How to log-2 transform a matrix

2007-11-10 Thread affy snp
PROTECTED] wrote: On 10-Nov-07 14:25:32, affy snp wrote: Dear list, I am wondering how to log-2 based transform a matrix with numeric values? I tried CGHlog2-log2(CGH) but got an error. Then I found for log2(x) in R, the x has to be a numeric or complex vector. Any method for a matrix

[R] How to subset a portion of columns from a matrix

2007-11-09 Thread affy snp
Dear List, Hi! I am wondering what is the simplest way to subset a portion of columns from a matrix. For example, there is a matrix A (238,304*243). What is the simplest way to get a sub-matrix B which comprises of column 1, 3, 5, 7,9,...(odd column number) from matrix A? Thank you very much

Re: [R] How to subset a portion of columns from a matrix

2007-11-09 Thread affy snp
Science University of Washington 1122 NE Boat Street Seattle, WA 98105 Phone: 206-221-6864 affy snp wrote: Dear List, Hi! I am wondering what is the simplest way to subset a portion of columns from a matrix. For example, there is a matrix A (238,304*243). What is the simplest

Re: [R] How to subset a portion of columns from a matrix

2007-11-09 Thread affy snp
I figured that out. I appreciate! Allen On Nov 9, 2007 11:25 PM, Julian Burgos [EMAIL PROTECTED] wrote: No problem. Actually, I missed a comma. You should do A[,seq(1,dim(A)[2],2)] Julian affy snp wrote: Hi Julian, Thanks for the help! Best, Allen On Nov 9

[R] How to more efficently read in a big matrix

2007-11-09 Thread affy snp
Dear list, I need to read in a big table with 487 columns and 238,305 rows (row names and column names are supplied). Is there a code to read in the table in a fast way? I tried the read.table() but it seems that it takes forever :( Thanks a lot! Best, Allen

Re: [R] How to more efficently read in a big matrix

2007-11-09 Thread affy snp
? Have you considered a database with this amount of data? On Nov 9, 2007 11:39 PM, affy snp [EMAIL PROTECTED] wrote: Dear list, I need to read in a big table with 487 columns and 238,305 rows (row names and column names are supplied). Is there a code to read in the table in a fast way? I

Re: [R] How to more efficently read in a big matrix

2007-11-09 Thread affy snp
are transposed, but if you have enough memory, you can transpose them, or just leave the data as is, and change your processing to reorder the rows/cols. This should lets you read it in in the fastest manner and then play with it. On Nov 9, 2007 11:52 PM, affy snp [EMAIL PROTECTED] wrote: Hi Jim

Re: [R] How to more efficently read in a big matrix

2007-11-09 Thread affy snp
Hi Jim, Actually besides the first column which is character, half of the 486 columns are character as well. Thanks! Allen On Nov 10, 2007 12:29 AM, affy snp [EMAIL PROTECTED] wrote: Hi Jim, I tired scan() first and got x - scan(file=243_47mel_withnormal_expression_log2.txt, what=0

Re: [R] How to more efficently read in a big matrix

2007-11-09 Thread affy snp
) [1] 2424 This took about 7 seconds. You have about 40X more data, so it should be interesting to see how it scales up. The object size if 24MB, so 40X more is about 1GB. On Nov 9, 2007 11:52 PM, affy snp [EMAIL PROTECTED] wrote: Hi Jim, Thanks a lot! I am currently running

Re: [R] How to more efficently read in a big matrix

2007-11-09 Thread affy snp
BTW, sth like: A-read.table(file=243_47mel_withnormal_expression_log2.txt, +header=TRUE,row.names=1,colClasses=c('factor', rep('factor',486))) will do anything good? Allen On Nov 10, 2007 12:41 AM, affy snp [EMAIL PROTECTED] wrote: Yes, I am showing the first 5 columns as an example. Thank

Re: [R] How to more efficently read in a big matrix

2007-11-09 Thread affy snp
)) : invalid connection How should I correct this? Thanks! Allen On Nov 10, 2007 1:11 AM, Gabor Grothendieck [EMAIL PROTECTED] wrote: On Nov 10, 2007 12:25 AM, affy snp [EMAIL PROTECTED] wrote: Hi Gabor, Thanks a lot! The header of the big file looks like as follows: probe_set