ec.Move: DataFrame Tools : Move a column

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

Move a column to the first column, or at the end of the dataset or before or after a specified column

Usage

1
ec.Move(tomove, where = "last", target = NULL)

Arguments

tomove

- a string, the name of the column to be moved

where

- a string, can be "first", "last" (default), "before", "after".

target

- an optional string, the name of the relative column when "before" or "after" are used

Details

TODO

Value

Return nothing. GDS the Global DataSet is modified

Note

TODO

Author(s)

jp.decorps@epiconcept.fr

References

TODO

See Also

This function is a derivative work from an answer than you can see here :

http://stackoverflow.com/questions/18339370/reordering-columns-in-a-large-dataframe

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(mtcars)
ec.Use(mtcars)
colnames(GDS);
ec.Move("mpg", "last")
colnames(GDS)
ec.Move("mpg", "first")
colnames(GDS)
ec.Move("mpg", "before", "am")
colnames(GDS)
ec.Move("mpg", "after", "am")
colnames(GDS)

Epiconcept-Paris/Epiconcepts documentation built on May 6, 2019, 3:49 p.m.