Reorders columns of a data.frame by moving MOVECOLS in the sequence listed to a position after AFTER

MoveAfter(DFR, MOVECOLS, AFTER)

Arguments

DFR

data.frame to be reordered

MOVECOLS

colnames or colnumbers of the block to be moved

AFTER

=NULL colname or colnumber after which the block MOVECOLS should be placed. If NULL MOVECOLS are put in front.

Value

reordered data.frame

Examples

if (FALSE) { a<-c(rep("M",240),rep("F",170)) b<-sample(c(rep("Stage1",110),rep("Stage2",180),rep("Stage3",120)),410) DFR<-CrossTabs(a,b,TYPE="COL",PVALUE=F,VARNAME=T,LONGNAME="EGON",NOZEROS=T,ALL=NULL) colnames(DFR) DFR MoveAfter(DFR,c("%All"," All"),NULL) MoveAfter(DFR,c(10,9),1) MoveAfter(DFR,c(" All","%All")," Stage1") }