Re: cbind problem (PR#339)

About this list Date view Thread view Subject view Author view Other groups

Subject: Re: cbind problem (PR#339)
From: Thomas Lumley (thomas@biostat.washington.edu)
Date: Wed 24 Nov 1999 - 04:39:38 EST


Message-ID: <Pine.GSO.4.10.9911231038330.18031-100000@wompom.biostat.washington.edu>

On Tue, 23 Nov 1999 thomas@biostat.washington.edu wrote:

>
> Probably related to the rbind problem:
>
Yep.

Patch:

*** /usr/local/src/R-0.90.0/src/main/bind.c Fri Nov 12 15:33:28 1999
--- /biostat/faculty0/thomas/Rarchive/r-devel/R/src/main/bind.c Tue Nov 23 10:16:47 1999
***************
*** 1087,1093 ****
  
      /* Adjustment of dimnames attributes. */
      if (have_cnames | have_rnames) {
! SEXP nam, tnam;
          PROTECT(dn = allocVector(VECSXP, 2));
          if (have_cnames)
              nam = VECTOR(dn)[1] = allocVector(STRSXP, cols);
--- 1087,1093 ----
  
      /* Adjustment of dimnames attributes. */
      if (have_cnames | have_rnames) {
! SEXP nam, tnam,v;
          PROTECT(dn = allocVector(VECSXP, 2));
          if (have_cnames)
              nam = VECTOR(dn)[1] = allocVector(STRSXP, cols);
***************
*** 1100,1112 ****
  
                  if (isMatrix(u)) {
  
! u = getAttrib(u, R_DimNamesSymbol);
! tnam = GetColNames(u);
  
                      if (have_rnames &&
                          GetRowNames(dn) == R_NilValue &&
! GetRowNames(u) != R_NilValue)
! SetRowNames(dn, duplicate(GetRowNames(u)));
  
                      /* rbind() does this only if(have_?names) .. : */
                      if (tnam != R_NilValue) {
--- 1100,1112 ----
  
                  if (isMatrix(u)) {
  
! v = getAttrib(u, R_DimNamesSymbol);
! tnam = GetColNames(v);
  
                      if (have_rnames &&
                          GetRowNames(dn) == R_NilValue &&
! GetRowNames(v) != R_NilValue)
! SetRowNames(dn, duplicate(GetRowNames(v)));
  
                      /* rbind() does this only if(have_?names) .. : */
                      if (tnam != R_NilValue) {

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b25 : Tue 04 Jan 2000 - 14:16:10 EST