Skip to content

Commit

Permalink
rep() for raw type
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/branches/rawtype@29836 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
ripley committed Jun 14, 2004
1 parent c7cc35d commit d532d69
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/seq.c
Expand Up @@ -189,6 +189,11 @@ static SEXP rep2(SEXP s, SEXP ncopy)
u = CDR(u);
}
break;
case RAWSXP:
for (i = 0; i < nc; i++)
for (j = 0; j < (INTEGER(t)[i]); j++)
RAW(a)[n++] = RAW(s)[i];
break;
default:
UNIMPLEMENTED("rep2");
}
Expand Down Expand Up @@ -270,6 +275,10 @@ static SEXP rep(SEXP s, SEXP ncopy)
for (i = 0; i < na; i++)
SET_VECTOR_ELT(a, i, duplicate(VECTOR_ELT(s, i% ns)));
break;
case RAWSXP:
for (i = 0; i < na; i++)
RAW(a)[i] = RAW(s)[i % ns];
break;
default:
UNIMPLEMENTED("rep");
}
Expand Down

0 comments on commit d532d69

Please sign in to comment.