reorder_df: reorder_df

Description Usage Arguments Value Examples

View source: R/reorder_df_function.R

Description

Reorders the rows of one dataframe according to another vector (id vector)

Usage

1
reorder_df(df, col_sort, reorder_data)

Arguments

df

dataframe to reorder

col_sort

column on which the rows will be reordered

reorder_data

vector with the new order

Value

Reordered dataframe

Examples

1
2
3
4
5
6
7
df <- data.frame(a = letters[1:3],b = LETTERS[4:6],c = 7:9)

reorder_data<-c("c","a","b")

df_new<-reorder_df(df,"a",reorder_data)

df_new

MatthewSmith430/ITNr documentation built on Oct. 30, 2018, 8 a.m.