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

2007-12-24 Thread affy snp
801510L, 230957584L, > 237932418L, 65724492L, 65879898L, 67718674L, 68318411L, 68454651L, > 68567494L), s1 = c(-1L, -1L, -1L, -1L, -1L, 0L, 0L, 0L, 0L, 0L, > 0L, 0L, 0L, 0L), s2 = c(0L, 0L, 0L, 0L, 0L, -1L, -1L, -1L, 1L, > 1L, 0L, 0L, 0L, 0L), Count = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, >

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

2007-12-24 Thread affy snp
uot;) > ) > } > > do.call("rbind", lapply(lapply(split(df, paste(df$s1, df$s2)), f), > unique)) > > > On 24/12/2007, affy snp <[EMAIL PROTECTED]> wrote: > > Thanks Moshe! I apologize for not being so clear about the > > second part. Again,

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

2007-12-24 Thread affy snp
; 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 <[EMAIL PROTECTED]> wrote: > > > Hello list, > > > > I have a data frame M like: > > > >

[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 RP11-21

[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]=

[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 in

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 ori

Re: [R] hclust in heatmap.2

2007-12-06 Thread affy snp
entist - Pacific Northwest National Lab > > On Dec 5, 2007 4: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 orde

[R] hclust in heatmap.2

2007-12-05 Thread affy snp
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 will be appreciated! Best, Allen [[alternative HTM

Re: [R] about col in heatmap.2

2007-11-30 Thread affy snp
#x27;green','blue')) > levelplot(x,col.regions=Lab.palette(10)) > > > On Nov 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 t

Re: [R] about col in heatmap.2

2007-11-30 Thread affy snp
im(old.data) > > and then plot it. > > On Nov 30, 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

[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 mak

[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

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

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

2007-11-29 Thread affy snp
hich 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 PROTECTED]> wrote: > > Hi Jim, > > > > Thanks a lot! I would like the blanks to be read as NAs. > > I tried

[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-28 Thread affy snp
t;[EMAIL PROTECTED]> wrote: > 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]&

[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 https://stat.ethz.ch/mailman/listi

[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?

Re: [R] Heatmap problem

2007-11-22 Thread affy snp
icht- > Van: [EMAIL PROTECTED] [mailto:[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

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 = "c

[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]] __

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

2007-11-18 Thread affy snp
1:4] [,1] [,2] [,3] [,4] [1,] 43121 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, Be

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

2007-11-18 Thread affy snp
ov 18, 2007, at 1:54 PM, Henrique Dallazuanna wrote: > > > clones.info[order(clones.info$CHROMOSOME),] > > > > -- > > Henrique Dallazuanna > > Curitiba-Paraná-Brasil > > 25° 25' 40" S 49° 16' 22" O > > > > > > On 18/11/2007, affy sn

[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 414196

Re: [R] About print a label in plot

2007-11-16 Thread affy snp
function. There are many different plot > functions with different 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 > > af

[R] Plot problem

2007-11-15 Thread affy snp
Dear list, I have a question about using plot(). I tried the code: 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.

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

[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: 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.

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

2007-11-14 Thread affy snp
clinical 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 > &

[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 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.

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 rowMed

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

2007-11-12 Thread affy snp
7,] / myAvg > > > On Nov 12, 2007 1: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 t

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

2007-11-12 Thread affy snp
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 as the reference column. Second, I want to use each column o

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

2007-11-11 Thread affy snp
nvert to matrix, get rid of first column > > x <- as.matrix(x[,-1]) > > y <- as.matrix(y[,-1]) > > z <- mapply(function(a,b)mean(c(a,b), na.rm=TRUE), x, y) > > dim(z) <- dim(x) > > z > [,1] [,2] [,3] > [1,] 2.045 > [2,] 1.52 NaN

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

2007-11-11 Thread affy snp
lumn > > x <- as.matrix(x[,-1]) > > y <- as.matrix(y[,-1]) > > z <- mapply(function(a,b)mean(c(a,b), na.rm=TRUE), x, y) > > dim(z) <- dim(x) > > z > [,1] [,2] [,3] > [1,] 2.045 > [2,] 1.52 NaN > [3,] 2.542 > >

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

2007-11-11 Thread affy snp
0 3.33 4.00 > Allen On Nov 11, 2007 10:41 PM, jim holtman <[EMAIL PROTECTED]> wrote: > What did your text files look like? It would appear that there was > not a line feed on the last line of the file. Also what does 'str' of > x and y show? It appears t

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

2007-11-11 Thread affy snp
> > y > [,1] [,2] [,3] > [1,] NA44 > [2,]22 NA > [3,]122 > > z <- mapply(function(a,b)mean(c(a,b), na.rm=TRUE), x, y) > > dim(z) <- dim(x) > > z > [,1] [,2] [,3] > [1,] 2.045 > [2,] 1.52 NaN &g

[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. T

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

2007-11-11 Thread affy snp
ng 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 <[EMAIL PROTECTED]> wrote: > > Gabor, > > > > I will do it either later today or t

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

2007-11-10 Thread affy snp
Ted Harding <[EMAIL 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) i

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

2007-11-10 Thread affy snp
ems (you haven't told us > what type 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: > >

[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 Math.da

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

2007-11-09 Thread affy snp
"), "from myfile") > DF <- sqldf(stmt, file.format = list(sep = " ")) Error in summary.connection(get(fo, envir)) : invalid connection > How should I correct this? Thanks! Allen On Nov 10, 2007 1:11 AM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > On Nov

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

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

2007-11-09 Thread affy snp
x27;)) > > You can extend the 'what' to the size of the column that you have; e.g. > > what=c(rep(c(list(''), list(0)), rep=243), list('')) > > > > > On Nov 10, 2007 12:29 AM, affy snp <[EMAIL PROTECTED]> wrote: > > Hi Jim, > &

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

2007-11-09 Thread affy snp
ed (Mb) > Ncells 169954 4.6 35 9.4 35 9.4 > Vcells 3102277 23.77803840 59.6 7200206 55.0 > > object.size(x) > [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 objec

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_47me

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

2007-11-09 Thread affy snp
; it on subsequent runs which should be fast. > > 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

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

2007-11-09 Thread affy snp
comes in in > row order if that is what your data file has, so you could just add > dimensions of > > dim(x) <- c(487, 238305) > > rows and columns are transposed, but if you have enough memory, you > can transpose them, or just leave the data as is, and change your > pro

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

2007-11-09 Thread affy snp
e is the file you are reading > and what is its format? 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,

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

2007-11-09 Thread affy snp
ould do > > > > A[,seq(1,dim(A)[2],2)] > > > > Julian > > > > > > > > affy snp wrote: > > > Hi Julian, > > > > > > Thanks for the help! > > > > > > Best, > > > Allen > > > > >

[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 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, &g

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

2007-11-09 Thread affy snp
Research Lab > School of Aquatic and Fishery 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

[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 for