Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/main/seq.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,10 +744,11 @@ attribute_hidden SEXP do_rep(SEXP call, SEXP op, SEXP args, SEXP rho)
errorcall(call, _("invalid '%s' argument"), "times");
len = lx * it * each;
} else { // nt != 1
if(nt != (double) lx * each)
errorcall(call,_("invalid '%s' argument: length of time = %d, expected = %d from (length of x = %d , each = %d) "),"times",nt,(int)((double) lx * each),(int) lx , (int) each );


if(nt != (double) lx * each){
if(each == 0) errorcall(call, _("invalid '%s' argument, given the value of '%s' "), "each","times");
if(each == 1) errorcall(call,_("invalid '%s' argument"),"times");
errorcall(call, _("invalid '%s' argument, given the value of '%s'"), "times", "each");
}
if (TYPEOF(times) == REALSXP)
for(i = 0; i < nt; i++) {
double rt = REAL(times)[i];
Expand Down