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
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
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
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
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
5 matches
Mail list logo