Re: [R] extracting column at regular intervals starting from different columns

2012-09-18 Thread Berend Hasselman
On 18-09-2012, at 19:21, eliza botto wrote: > > Dear useRs, > i had a matrix with 31 rows and 444 columns and i wanted to extract every > 37th column of that matrix starting from 1. more precisely i wanted to select > columns 1, 38,75, 112 and so on. then doing the same by starting from column

Re: [R] extracting column at regular intervals starting from different columns

2012-09-18 Thread Clint Bowman
Try: x <- 1:444 start<-2 x[c(rep(FALSE,start-1),TRUE, rep(FALSE, 36-start+1))] # [1] 2 39 76 113 150 187 224 261 298 335 372 409 start<-30 x[c(rep(FALSE,start-1),TRUE, rep(FALSE, 36-start+1))] # [1] 30 67 104 141 178 215 252 289 326 363 400 437 start<-37 x[c(rep(FALSE,start-1),TRUE, rep(F

Re: [R] extracting column at regular intervals starting from different columns

2012-09-18 Thread Berend Hasselman
On 18-09-2012, at 19:21, eliza botto wrote: > > Dear useRs, > i had a matrix with 31 rows and 444 columns and i wanted to extract every > 37th column of that matrix starting from 1. more precisely i wanted to select > columns 1, 38,75, 112 and so on. then doing the same by starting from column

Re: [R] extracting column at regular intervals starting from different columns

2012-09-18 Thread David Winsemius
On Sep 18, 2012, at 10:21 AM, eliza botto wrote: > > Dear useRs, > i had a matrix with 31 rows and 444 columns and i wanted to extract every > 37th column of that matrix starting from 1. more precisely i wanted to select > columns 1, 38,75, 112 and so on. then doing the same by starting from c

[R] extracting column at regular intervals starting from different columns

2012-09-18 Thread eliza botto
Dear useRs, i had a matrix with 31 rows and 444 columns and i wanted to extract every 37th column of that matrix starting from 1. more precisely i wanted to select columns 1, 38,75, 112 and so on. then doing the same by starting from column number 2(2,39,76,113...). i was advised to use >x