rbind Questions

4

Solved

I would like to merge a large set of dataframes (about 30), which each have about 200 variables. These datasets are very much alike but not identical. Please find two example dataframes below: li...
Customhouse asked 16/4, 2019 at 10:57

10

Solved

I am just starting with R and encountered a strange behaviour: when inserting the first row in an empty data frame, the original column names get lost. example: a<-data.frame(one = numeric(0),...
Rhyner asked 8/3, 2011 at 11:1

6

Solved

The goal is to convert a nested list which sometimes contain missing records into a data frame. An example of the structure when there are missing records is: mylist <- list( list( Hit = &quot...
Derision asked 3/10, 2014 at 10:46

6

Solved

I have a list of dataframes for which I am certain that they all contain at least one row (in fact, some contain only one row, and others contain a given number of rows), and that they all have the...
Dunagan asked 12/5, 2011 at 15:13

3

Solved

I am going through documentation of data.table and also noticed from some of the conversations over here on SO that rbindlist is supposed to be better than rbind. I would like to know why is rbind...
Mapes asked 28/3, 2013 at 3:5

3

Solved

I have a list of sf objects that I would like to row bind to create a single sf object. I'm looking for a function similar to data.table::rbindlist, that would stack the individual objects in an ef...
Boyar asked 12/7, 2018 at 19:14

2

Solved

I have to bind/merge dataframes in an iterative process in R. In occasions, some of the dataframes might not exist for reasons I will not explain here. I would like to know how I could bind datafra...
Ignace asked 19/1, 2022 at 9:51

3

Solved

I want to assign a rowname (A_B) while I rbind a row into a new dataframe (d). The row is the result of the ratio of two rows of another data frame (df). df <- data.frame(ID = c("A", "B" ),re...
Gonfalon asked 1/2, 2017 at 14:45

4

Solved

I have a list of data frames with different sets of columns. I would like to combine them by rows into one data frame. I use plyr::rbind.fill to do that. I am looking for something that would do th...
Vociferant asked 1/8, 2013 at 20:16

5

Solved

I've 12 data frames, each one contains 6 columns: 5 have the same name, 1 is different. Then when I call rbind() I get: Error in match.names(clabs, names(xi)) : names do not match previous names ...
Hallowell asked 17/2, 2015 at 16:48

4

Solved

Say I have two vectors v1 and v2 and that I want to call rbind(v1, v2). However, supposed length(v1) > length(v2). From the documentation I have read that the shorter vector will be recycled. He...
Microparasite asked 15/5, 2013 at 3:44

6

I have the following matrix FI1 FI2 YI1 YI2 BAL1 BAL2 GRO1 GRO2 EQ1 EQ2 1 0.22 0.15 0.1 0.1 0.05 0.05 0.05 0.05 0.05 0.05 2 0.22 0.00 0.0 0.0 0.00 0.00 0.00 0.00 0.00 0.00 3 0.22 0.00 0.0 0.0 0.00...
Dynamometer asked 25/10, 2013 at 12:57

1

Solved

I have 12 datasets that all resemble this (this is a sample, the real datasets all contain over 10,000 varying rows, with the same number/name of columns) df1 Start End Duration 9/10/2019 1:0...
Antibaryon asked 12/2, 2020 at 23:16

2

Solved

Why does the following code not work? library(data.table) team_table <- as.data.table(matrix(NA,ncol = 11)) rbind(team_table,1:11) While the same version with data.frame does? team_table &lt...
Hanoverian asked 21/1, 2020 at 23:38

4

Solved

I am attempting to row bind many data frames together into a single massive data frame. The data frames are named sequentially with the first named df1, the second named df2, the third named df3, e...
Outermost asked 7/12, 2014 at 22:11

2

Solved

On the web, I found that rbind() is used to combine two data frames by rows, and the same task is performed by bind_rows() function from dplyr. What's the difference between these two functions, an...
Confraternity asked 19/3, 2017 at 13:34

4

Heres my data: > data Manufacturers Models 1 Audi RS5 2 BMW M3 3 Cadillac CTS-V 4 Lexus ISF I would like to add 1 row in the fourth row, like this: > data Manufacturers Models 1 Au...
Bacteriophage asked 27/4, 2013 at 8:20

2

Solved

While duplicated row (and column) names are allowed in a matrix, they are not allowed in a data.frame. Trying to rbind() some data frames having row names in common highlights this problem. Conside...
Infusionism asked 23/10, 2012 at 20:8

2

There are other issues here addressing the same question, but I don't realize how to solve my problem based on it. So, I have 5 data frames that I want to merge rows in one unique data frame using ...
Eagan asked 31/3, 2014 at 16:14

5

Solved

I have a list like L (comes from a vector splitting). L <- strsplit(c("1 5 9", "", "3 7 11", ""), " ") # [[1]] # [1] "1" "5" "9" # # [[2]] # character(0) # # [[3]] # [1] "3" "7" "11" # # [[...
Lyricism asked 13/4, 2019 at 6:28

6

Solved

I have written the following function to combine 300 .csv files. My directory name is "specdata". I have done the following steps for execution, x <- function(directory) { dir <- directory...
Apologist asked 21/4, 2014 at 3:15

2

Solved

I am trying to find an efficient (fast in running and simple in coding) way to do the rbind.fill function but in base R. From my searching, there seems to be plenty of library functions such as sma...
Mena asked 7/8, 2018 at 15:21

1

Solved

Caveat: novice. I have several data.tables with millions of rows each, variables are mostly dates and factors. I was using rbindlist() to combine them because. Yesterday, after breaking up the tabl...
Beechnut asked 25/7, 2018 at 16:27

7

Solved

rbind does not check for column names when binding together vectors: l = list(row1 = c(10, 20), row2 = c(20, 10)) names(l$row1) = c("A", "B") names(l$row2) = c("B", "A") l $row1 A B 10 20 $row...
Clutch asked 6/6, 2013 at 12:50

2

Solved

I have many variables that I have created using code like this: for (i in 1:10) { assign(paste0("variable", i), i )} I now need to use rbind on the variables to combine them. I tried something ...
Tupiguarani asked 29/9, 2013 at 3:41

© 2022 - 2025 — McMap. All rights reserved.