The R Project SVN R

Rev

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

Rev 8628 Rev 9147
Line 600... Line 600...
600
    return ans;
600
    return ans;
601
}
601
}
602
 
602
 
603
SEXP do_transpose(SEXP call, SEXP op, SEXP args, SEXP rho)
603
SEXP do_transpose(SEXP call, SEXP op, SEXP args, SEXP rho)
604
{
604
{
605
    SEXP a, r, dims, dimnames, dimnamesnames=R_NilValue, 
605
    SEXP a, r, dims, dimnames, dimnamesnames=R_NilValue,
606
	ndimnamesnames, rnames, cnames;
606
	ndimnamesnames, rnames, cnames;
607
    int i, len = 0, ncol=0, nrow=0;
607
    int i, len = 0, ncol=0, nrow=0;
608
 
608
 
609
    checkArity(op, args);
609
    checkArity(op, args);
610
    a = CAR(args);
610
    a = CAR(args);
Line 782... Line 782...
782
	for (i = 0; i < len; i++) {
782
	for (i = 0; i < len; i++) {
783
	    j = swap(i, dimsa, dimsr, perm, ind1, ind2);
783
	    j = swap(i, dimsa, dimsr, perm, ind1, ind2);
784
	    VECTOR(r)[j] = VECTOR(a)[i];
784
	    VECTOR(r)[j] = VECTOR(a)[i];
785
	}
785
	}
786
    default:
786
    default:
787
	errorcall(call, "invalid argument");
787
	errorcall(call, R_MSG_IA);
788
    }
788
    }
789
 
789
 
790
    if (INTEGER(CAR(CDDR(args)))[0])
790
    if (INTEGER(CAR(CDDR(args)))[0])
791
	setAttrib(r, R_DimSymbol, dimsr);
791
	setAttrib(r, R_DimSymbol, dimsr);
792
    else
792
    else