[EMAIL PROTECTED] wrote:
Full_Name: Hin-Tak Leung
Version: R 2.2.1
OS: x86_64-redhat-linux-gnu
Submission from: (NULL) (131.111.186.92)


Matrix subset assignment and [[<- assignment
are unimplemented for raw (RAWSXP) types.

I have a working patch implementing the functionality,
to follow.

Same thing, sorry for two bug reports and two patches related
to RAWSXP, but they are independent issues.

Attached in ready-to-patch form and also insert (white spaces
will go wrong) here. Please review, comment and possibly commit,
and hope to see it in R 2.3.x.

======================
--- src/main/subassign.c.orig   2005-12-05 23:00:17.000000000 +0000
+++ src/main/subassign.c        2006-01-27 12:50:47.000000000 +0000
@@ -868,6 +868,23 @@
            }
        }
        break;
+    case 2424: /* raw   <- raw   */
+
+       for (j = 0; j < ncs; j++) {
+           jj = INTEGER(sc)[j];
+           if (jj == NA_INTEGER) continue;
+           jj = jj - 1;
+           for (i = 0; i < nrs; i++) {
+               ii = INTEGER(sr)[i];
+               if (ii == NA_INTEGER) continue;
+               ii = ii - 1;
+               ij = ii + jj * nr;
+               RAW(x)[ij] = RAW(y)[k];
+               k = (k + 1) % ny;
+           }
+       }
+       break;
+
     default:
error(_("incompatible types (case %d) in matrix subset assignment"),
              which);
@@ -1611,6 +1628,11 @@
            SET_VECTOR_ELT(x, offset, y);
            break;

+       case 2424:      /* raw <- raw */
+
+           RAW(x)[offset] = RAW(y)[0];
+           break;
+
        default:
            error(_("incompatible types (%d) in [[ assignment"), which);
        }
===========================
______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to