s-news
[Top] [All Lists]

rbind.Matrix (Matrix Library)

To: s-news@wubios.wustl.edu
Subject: rbind.Matrix (Matrix Library)
From: Pierre.Ilouga@evotecoai.com
Date: Thu, 26 Feb 2004 15:52:18 +0100
Dear Splus-users,

my question occurs due to the fact that the description of the function
"rbind.Matrix" from the "Matrix" library is very poor. The goal is to avoid
the function "rbind" and to use instead "rbind.Matrix" which is faster for
very large data frames.
Let's consider the simplified example:

A<-data.frame(Fact=LETTERS[1:3],NR=1:3)         ## 3x3-data.frame
B<-data.frame(Fact=LETTERS[1:2],NR=1:2)         ## 2x3-data.frame

C1<-rbind(A,B)
> C1
  Fact NR
1    A  1
2    B  2
3    C  3
4    D  1
5    E  2

library(Matrix)
C2<-rbind.Matrix(A,B)
> C2
          Fact         NR
[1,] factor, 3 numeric, 3
[2,] factor, 2 numeric, 2
attr(, "class"):
[1] "Matrix"

Is there any Splus-function (or other possibilities except for loops) which
enables to generate the data frame C1 from C2?

Regards.
Pierre.

S-PLUS : Copyright (c) 1988, 2002 Insightful Corp.
S : Copyright Lucent Technologies, Inc.
Version 6.1.2 Release 2 for Linux 2.2.12 : 2002

Dr. Pierre Ilouga
EVOTEC OAI
Screening Operations/Discovery Informatics
Schnackenburgallee 114
D-22525 Hamburg
Germany




<Prev in Thread] Current Thread [Next in Thread>