The R Project SVN R

Rev

Rev 51095 | Rev 51245 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 51095 Rev 51181
Line 668... Line 668...
668
    int i, len, *p;
668
    int i, len, *p;
669
 
669
 
670
    checkArity(op, args);
670
    checkArity(op, args);
671
    len = asInteger(CAR(args));
671
    len = asInteger(CAR(args));
672
    if(len == NA_INTEGER || len < 0)
672
    if(len == NA_INTEGER || len < 0)
673
	errorcall(call, _("argument must be non-negative"));
673
	errorcall(call, _("argument must be coercible to non-negative integer"));
674
    ans = allocVector(INTSXP, len);
674
    ans = allocVector(INTSXP, len);
675
    p = INTEGER(ans);
675
    p = INTEGER(ans);
676
    for(i = 0; i < len; i++) p[i] = i+1;
676
    for(i = 0; i < len; i++) p[i] = i+1;
677
 
677
 
678
    return ans;
678
    return ans;