Description Usage Arguments Value Author(s) See Also Examples
Re-order named columns to front or back of data.frame
1 2 3 | order_cn_front(x, cn)
order_cn_back(x, cn)
|
x |
|
cn |
|
data.frame
with re-ordered columns
Thomas P. Harte
data.frame
, dplyr::everything
,
http://stackoverflow.com/questions/27865865/in-dplyr-how-to-delete-and-rename-columns-that-dont-exist-manipulate-all-name
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | tab<- read.table(
con<- textConnection(
"Name Age Salary ID
Dick 38 32k 1
Tom 21 21k 2
Harry 56 NA 3"
),
header=TRUE,
colClasses=c("character","integer","character","integer")
)
close(con)
tab
tab %>% order_cn_front(c("Salary","Age"))
tab %>% order_cn_back(c("Salary","Age"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.