Message-ID: <73f827b50901080312o5d873eafgf65fc4319b156621@mail.gmail.com>
Date: 2009-01-08T11:12:16Z
From: Gundala Viswanath
Subject: Faster Printing Alternatives to 'cat'
Dear all,
I found that printing with 'cat' is very slow.
For example in my machine this snippet
__BEGIN__
# I need to resolve to use this type of loop.
# because using write(), I need to create a matrix which
# consumes so much memory. Note that "foo, bar, qux" object
# is already very large (>2Gb)
for ( s in 1:length(x) ) {
cat(as.character(foo[s]),"\t",bar[s],"\t", qux[s],"\n")
}
__END__
for "x" of size ~1.5million, takes more than 10 hours to print.
On my Linux 1994.MHz AMD processor.
Is there any faster alternatives to "cat" ?
- Gundala Viswanath
Jakarta - Indonesia