The R Project SVN R

Rev

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

Rev 10172 Rev 26571
Line 41... Line 41...
41
    nobs = LENGTH(CAR(args));
41
    nobs = LENGTH(CAR(args));
42
    if (nobs <= 0)
42
    if (nobs <= 0)
43
	return R_NilValue;
43
	return R_NilValue;
44
    if (nfac <= 0)
44
    if (nfac <= 0)
45
	errorcall(call, "Group length is 0 but data length > 0");
45
	errorcall(call, "Group length is 0 but data length > 0");
46
    if (nobs != nfac)
46
    if (nobs % nfac != 0)
47
	warningcall(call, "argument lengths differ");
47
	warningcall(call, "data length is not a multiple of split variable");
48
    PROTECT(counts = allocVector(INTSXP, nlevs));
48
    PROTECT(counts = allocVector(INTSXP, nlevs));
49
    for (i = 0; i < nlevs; i++)
49
    for (i = 0; i < nlevs; i++)
50
	INTEGER(counts)[i] = 0;
50
	INTEGER(counts)[i] = 0;
51
    for (i = 0; i < nobs; i++) {
51
    for (i = 0; i < nobs; i++) {
52
	j = INTEGER(f)[i % nfac];
52
	j = INTEGER(f)[i % nfac];