Skip to content

Instantly share code, notes, and snippets.

@hoxo-m
Created October 16, 2017 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoxo-m/7cd5116a853259452a02594ca3aa9529 to your computer and use it in GitHub Desktop.
Save hoxo-m/7cd5116a853259452a02594ca3aa9529 to your computer and use it in GitHub Desktop.
insert_data_frame <- function(df, df_added, col)
{
index <- which(col == names(df))
data.frame(append(df, list(df_added = df_added), index))[, -index]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment