2

I have a single DataFrame that needs to be sent to a Quality Test API that should return another DataFrame.

But unfortunately the API is not accepting the DataFrame as a whole and hence I am slicing it row by row and sending it to the API.

Hence I am getting single row DataFrames with each request. Can someone tell me how I can keep appending these single rows to a larger Data Frame?

djokester
  • 567
  • 9
  • 20

1 Answers1

4

You can append data frames to each other using bind_rows from the dplyr package.

df1 = data.frame(number = c(1, 2, 3, 4), 
                 name=c("Alice", "Bob", "Charlie", "Donna")
df2 = data.frame(number = c(5), name=c("Eve"))
df3 = bind_rows(df1, df2) #df3 has all five rows.
Restore the Data Dumps
  • 38,967
  • 12
  • 96
  • 122