Re: [R] resizing data

2013-01-25 Thread arun
Hi, Inline: - Original Message - From: emorway To: r-help@r-project.org Cc: Sent: Friday, January 25, 2013 5:29 PM Subject: Re: [R] resizing data I played around with your example on the smaller dataset, and it seemed like it was doing what I wanted.  However, applying it to the

Re: [R] resizing data

2013-01-25 Thread arun
HI, It's not clear why you wanted to take the transpose and resize it afterwards. It could be done in one step as David suggested. Suppose, you wanted to get the result after you transposed the matrix: x<-matrix(1:64,8) x1<-t(x) matrix(unlist(split(x1,row(x1))),ncol=4,byrow=T) #  [,1] [,2] [

Re: [R] resizing data

2013-01-25 Thread arun
which(x==1,arr.ind=TRUE)    row col #[1,] 1   7  y<-t(matrix(x,nrow=546))  which(y==1,arr.ind=TRUE) # row col #[1,] 341 328 A.K. - Original Message - From: emorway To: r-help@r-project.org Cc: Sent: Friday, January 25, 2013 5:29 PM Subject: Re: [R] resizing data I pla

Re: [R] resizing data

2013-01-25 Thread David Winsemius
On Jan 25, 2013, at 2:29 PM, emorway wrote: > I played around with your example on the smaller dataset, and it seemed like > it was doing what I wanted. However, applying it to the larger problem, I > didn't get a resized 2D dataset that preserved the order I was hoping for. > Hopefully the fol

Re: [R] resizing data

2013-01-25 Thread Brian Diggs
On 1/25/2013 2:29 PM, emorway wrote: I played around with your example on the smaller dataset, and it seemed like it was doing what I wanted. However, applying it to the larger problem, I didn't get a resized 2D dataset that preserved the order I was hoping for. Hopefully the following illustra

Re: [R] resizing data

2013-01-25 Thread emorway
I played around with your example on the smaller dataset, and it seemed like it was doing what I wanted. However, applying it to the larger problem, I didn't get a resized 2D dataset that preserved the order I was hoping for. Hopefully the following illustrates the larger problem: x<-matrix(0,nr

Re: [R] resizing data

2013-01-25 Thread David Winsemius
On Jan 25, 2013, at 1:12 PM, emorway wrote: > Undoubtedly this question has been asked before, I just can't seem to find > the combination of search terms to produce it. I'm trying to resize a > dataset that is pulled into R using read.table. However, I think the same > problem can be produced