Skip to content
Prev 2148 / 63424 Next

another multivariate ts bug

Paul Gilbert <pgilbert@bank-banque-canada.ca> writes:
Sigh.

Found and fixed. Same problem. This time in src/main/logic.c, lbinary
function. Here's the patch (cut+paste'd, watch out for whitespace
problems).

RCS file: /users/rdev/R/CVS-ARCHIVE/R/src/main/logic.c,v
retrieving revision 1.8
diff -c -r1.8 logic.c
*** logic.c     1999/03/05 19:19:04     1.8
--- logic.c     1999/05/11 21:02:09
***************
*** 110,121 ****
      y = CADR(args) = coerceVector(y, LGLSXP);
      PROTECT(x = binaryLogic(PRIMVAL(op), x, y));
  
-     if (xts || yts) {
-       setAttrib(x, R_TspSymbol, tsp);
-       setAttrib(x, R_ClassSymbol, class);
-       UNPROTECT(2);
-     }
- 
      if (dims != R_NilValue) {
        setAttrib(x, R_DimSymbol, dims);
        if(xnames != R_NilValue)
--- 110,115 ----
***************
*** 128,133 ****
--- 122,133 ----
            setAttrib(x, R_NamesSymbol, xnames);
        else if(length(x) == length(ynames))
            setAttrib(x, R_NamesSymbol, ynames);
+     }
+ 
+     if (xts || yts) {
+       setAttrib(x, R_TspSymbol, tsp);
+       setAttrib(x, R_ClassSymbol, class);
+       UNPROTECT(2);
      }
      UNPROTECT(4);
      return x;