The R Project SVN R

Rev

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

Rev 44023 Rev 44512
Line 70... Line 70...
70
    snc = CADDR(args);
70
    snc = CADDR(args);
71
    if (!isNumeric(snr) || !isNumeric(snc))
71
    if (!isNumeric(snr) || !isNumeric(snc))
72
	error(_("non-numeric matrix extent"));
72
	error(_("non-numeric matrix extent"));
73
    byrow = asLogical(CADDDR(args));
73
    byrow = asLogical(CADDDR(args));
74
    if (byrow == NA_INTEGER)
74
    if (byrow == NA_INTEGER)
75
	error(_("invalid 'byrow' value"));
75
	error(_("invalid '%s' argument"), "byrow");
76
    if(nargs == 5) dimnames = CAD4R(args);
76
    if(nargs == 5) dimnames = CAD4R(args);
77
 
77
 
78
 
78
 
79
    lendat = length(vals);
79
    lendat = length(vals);
80
    nr = asInteger(snr);
80
    nr = asInteger(snr);
Line 1022... Line 1022...
1022
	    iip[pp[i]]++;
1022
	    iip[pp[i]]++;
1023
	else
1023
	else
1024
	    error(_("value out of range in 'perm'"));
1024
	    error(_("value out of range in 'perm'"));
1025
    for (i = 0; i < n; i++)
1025
    for (i = 0; i < n; i++)
1026
	if (iip[i] == 0)
1026
	if (iip[i] == 0)
1027
	    error(_("invalid permutation ('perm')"));
1027
	    error(_("invalid '%s' argument"), "perm");
1028
 
1028
 
1029
    /* create the stride object and permute */
1029
    /* create the stride object and permute */
1030
 
1030
 
1031
    stride = (int *) R_alloc(n, sizeof(int));
1031
    stride = (int *) R_alloc(n, sizeof(int));
1032
 
1032
 
Line 1155... Line 1155...
1155
    x = CAR(args); args = CDR(args);
1155
    x = CAR(args); args = CDR(args);
1156
    n = asInteger(CAR(args)); args = CDR(args);
1156
    n = asInteger(CAR(args)); args = CDR(args);
1157
    p = asInteger(CAR(args)); args = CDR(args);
1157
    p = asInteger(CAR(args)); args = CDR(args);
1158
    NaRm = asLogical(CAR(args));
1158
    NaRm = asLogical(CAR(args));
1159
    if (n == NA_INTEGER || n < 0)
1159
    if (n == NA_INTEGER || n < 0)
1160
	error(_("invalid value of 'n'"));
1160
	error(_("invalid '%s' argument"), "n");
1161
    if (p == NA_INTEGER || p < 0)
1161
    if (p == NA_INTEGER || p < 0)
1162
	error(_("invalid value of 'p'"));
1162
	error(_("invalid '%s' argument"), "p");
1163
    if (NaRm == NA_LOGICAL) error(_("invalid value of 'na.rm'"));
1163
    if (NaRm == NA_LOGICAL) error(_("invalid '%s' argument"), "na.rm");
1164
    keepNA = !NaRm;
1164
    keepNA = !NaRm;
1165
 
1165
 
1166
    OP = PRIMVAL(op);
1166
    OP = PRIMVAL(op);
1167
    switch (type = TYPEOF(x)) {
1167
    switch (type = TYPEOF(x)) {
1168
    case LGLSXP: break;
1168
    case LGLSXP: break;