The R Project SVN R

Rev

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

Rev 60667 Rev 60844
Line 40... Line 40...
40
	error(_("second argument must be a factor"));
40
	error(_("second argument must be a factor"));
41
    int nlevs = nlevels(f);
41
    int nlevs = nlevels(f);
42
    R_xlen_t nfac = XLENGTH(CADR(args));
42
    R_xlen_t nfac = XLENGTH(CADR(args));
43
    R_xlen_t nobs = XLENGTH(CAR(args));
43
    R_xlen_t nobs = XLENGTH(CAR(args));
44
    if (nfac <= 0 && nobs > 0)
44
    if (nfac <= 0 && nobs > 0)
45
	error(_("Group length is 0 but data length > 0"));
45
	error(_("group length is 0 but data length > 0"));
46
    if (nfac > 0 && (nobs % nfac) != 0)
46
    if (nfac > 0 && (nobs % nfac) != 0)
47
	warning(_("data length is not a multiple of split variable"));
47
	warning(_("data length is not a multiple of split variable"));
48
    nm = getAttrib(x, R_NamesSymbol);
48
    nm = getAttrib(x, R_NamesSymbol);
49
    have_names = nm != R_NilValue;
49
    have_names = nm != R_NilValue;
50
    PROTECT(counts = allocVector(INTSXP, nlevs));
50
    PROTECT(counts = allocVector(INTSXP, nlevs));