Usage of rbind function
Title
Question
1. Can a row be inserted in the middle of data frame using rbind function?
2. Can multiple rows be inserted at once using rbind function in data frame?
3. Can a data be inserted at once in multiple data frames using rbind function?
R Operations-on-Matrices-and-Data-Frames 10-11 min 10-20 sec
Answers:
1. Can a row be inserted in the middle of the data frame using rbind function?
- Yes, we can. Please refer to the solution given on https://stackoverflow.com/questions/11561856/add-new-row-to-dataframe-at-specific-row-index-not-appended
Alternatively, you can use the function InsertRow available in the package DataCombine. For the documentation of InsertRow, please refer to https://www.rdocumentation.org/packages/DataCombine/versions/0.2.21/topics/InsertRow
2. Can multiple rows be inserted at once using rbind function in a data frame?
- Yes, we can do so by passing those vectors separated by a comma inside the rbind function.
Login to add comment