On Jan 2, 2008, at 6:05 PM, Talbot Katz wrote:
> Hi.
>
> I have a matrix stored in a large, tab-delimited flat file. The
> first row contains column names. Because the matrix is symmetric,
> the file has lower triangular format, so the second row contains
> one number, the third row two nu
After you read in the first line, read the rest of the file with a single scan:
rest <- scan(..., sep="\t", what=0, skip=1)
index <- 1 # used to march through 'rest'
for (i in 1:3000){
for (j in 1:i){
malt[i,j] <- rest[index]
index <- index+1
}
}
There are probably faster
Hi.
I have a matrix stored in a large, tab-delimited flat file. The first row
contains column names. Because the matrix is symmetric, the file has lower
triangular format, so the second row contains one number, the third row two
numbers, etc. In general, row k+1 contains k numbers; the mat
3 matches
Mail list logo