A user has a list of dataframes and he wants to convert it into single dataframe.How to do that?

747    Asked by shivangiMehta in Data Science , Asked on Nov 18, 2019
Answered by Nitin Solanki

listOfDataFrames <- vector(mode = "list", length = 100)

From dplyr package, we can use bind_rows to combine list of dataframes into single dataframe

To install dplyr package

install.package(“dplyr”)

library(dplyr)

bind_rows(list_of_dataframes, .id = "column_label")

Where

.id = "column_label" adds the unique row names based on the list of element names


Your Answer

Interviews

Parent Categories