similar to: problem with rbind on data.frames that contain data.frames

Displaying 20 results from an estimated 20000 matches similar to: "problem with rbind on data.frames that contain data.frames"

2010 Aug 05
1
rbind on data.frame that contains a column that is also a data.frame
Hi, The following was already a topic on r-help, but after understanding what is going on, I think it fits better in r-devel. The problem is this: When a data.frame has another data.frame in it, rbind doesn't work well. Here is an example: -- > a=data.frame(x=1:10,y=1:10) > b=data.frame(z=1:10) > b$a=a > b z a.x a.y 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5
2017 Jan 21
0
bug in rbind?
I'm not sure whether or not this is a bug, but I did isolate the line where the error is thrown: src/library/base/R/dataframe.R:1395. https://github.com/wch/r-source/blob/01374c3c367fa12f555fd354f735a6e16e5bd98e/src/library/base/R/dataframe.R#L1395 The error is thrown because the line attempts to set a subset of the rownames to NULL, which fails. R> options(error = recover) R>
2007 May 24
1
Is it possible to print a data.frame without the row names?
Is it possible to print a data.frame without the row names? I checked ?data.frame, ?print, ?format and didn't see anything that helped. In the example below, I would just like to show the two columns of data and not the row.names 1:10. > a<-data.frame(1:10, 21:30) > a X1.10 X21.30 1 1 21 2 2 22 3 3 23 4 4 24 5 5 25 6 6 26 7
2015 Feb 09
0
Proper way to define cbind, rbind for s4 classes in package
Hi Michael, I've tested your change in r67699 (using r67773) and the function now correctly dispatches to r/cbind2 within the R-session without bind_activation(TRUE). However, running unit tests using R CMD check I figured out that the same function call delegates to r/cbind.matrix (function uses S4 class as first- and matrix as second argument). Is this a bug and/or how can I get function
2015 Feb 11
0
Proper way to define cbind, rbind for s4 classes in package
sorry - I just got irritated by my different R-versions. The behaviour I described in the previous mail was discovered using R 3.1.2 without bind_activation(TRUE). In r67773 all calls are delegated to r/cbind.matrix and not r/cbind2. As a workaround I have now implemented an S3 method for my S4 class which correctly dispatches for both versions (3.1.2 and r67699+) - see also the commit for the h5
2019 Feb 11
1
make.unique rbind examples
The final two examples in ?make.unique do not appear to be relevant to that function, namely rbind(data.frame(x = 1), data.frame(x = 2), data.frame(x = 3)) rbind(rbind(data.frame(x = 1), data.frame(x = 2)), data.frame(x = 3)) both producing x 1 1 2 2 3 3 (identically) on R 3.4.3 and 3.5.1. Following a brief discussion on Twitter, Rich FitzJohn [1] identified that under R 1.8.0 (circa 2003,
2007 Jan 12
0
Minor logical bug in rbind.data.frame ?
When attempting to merge 3 data frames, one of which has fewer columns than the others, rbind.data.frame correctly refuses to perform the bind. However, the error message given is a bit obscure due to a logical bug in the match.names() internal function to rbind.data.frame. Illustration: ## Three data frames with same column variable names: > foo <- data.frame(v1 = c('a',
2015 Feb 20
1
Proper way to define cbind, rbind for s4 classes in package
>>>>> Mario Annau <mario.annau at gmail.com> >>>>> on Wed, 11 Feb 2015 20:18:53 +0100 writes: > sorry - I just got irritated by my different R-versions. > The behaviour I described in the previous mail was discovered using R > 3.1.2 without bind_activation(TRUE). In r67773 all calls are delegated > to r/cbind.matrix and not
2017 Jan 17
2
bug in rbind?
I suspect there may be a bug in base::rbind.data.frame Below there is minimal example of the problem: m <- matrix (1:12, 3) dfm <- data.frame (c = 1 : 3, m = I (m)) str (dfm) m.names <- m rownames (m.names) <- letters [1:3] dfm.names <- data.frame (c = 1 : 3, m = I (m.names)) str (dfm.names) rbind (m, m.names) rbind (m.names, m) rbind (dfm, dfm.names) #not working rbind
2000 Mar 09
1
For the record: how to merge data frames vertically
Hello, to save searching time in the S-news archive, here is the simple solution to merge data frames vertically (cols must be equivalent, of course). The frames must be components of a list, such as produced by framelist<-split(bigframe,factor). bigframe2<-do.call("rbind",framelist) # posted to S-news by Bill Venables, found in summary message
2015 Feb 02
2
Proper way to define cbind, rbind for s4 classes in package
>>>>> Michael Lawrence <lawrence.michael at gene.com> >>>>> on Sun, 1 Feb 2015 19:23:06 -0800 writes: > I've implemented the proposed changes in > R-devel. Minimally tested, so please try it. It should > delegate to r/cbind2 when there is at least one S4 > argument and S3 dispatch fails (so you'll probably want to
2015 Feb 09
2
Proper way to define cbind, rbind for s4 classes in package
Are you able to create a reproducible example, somehow? Thanks, Michael On Mon, Feb 9, 2015 at 2:28 PM, Mario Annau <mario.annau at gmail.com> wrote: > Hi Michael, > I've tested your change in r67699 (using r67773) and the function now > correctly dispatches to r/cbind2 within the R-session without > bind_activation(TRUE). However, running unit tests using R CMD check I
2008 Oct 30
0
Q: rbind problem in my code
I have a large matrix which is divided into several pieces, manipulated individually, and saved into RData in disc. After each pieces are done with operation, I load them into memory and use rbind to stack them back into matrix. however, the rbind is only give me the last two pieces. The following code illustrates the problem: 4 pieces of matrix (1000x1000) is created and stored in RData; then
2005 Mar 07
1
Faster way of binding multiple rows of data than rbind?
Hi all, I have a vector that contains the row numbers of data taken from several filtering operations performed on a large data frame (20,000rows x 500cols). In order to output this subset of data, I've been looping through the vector containing the row numbers (keepRows). output <- data.frame(row.names = rownames(bigMatrix)) for(i in keepRows) { output <- rbind(output,
2010 Sep 16
2
question about converting a matrix to a dataframe
First I have a matrix called stocks1: > class(stocks1) [1] "matrix" Here are the first 5 rows of the last 4 columns: > stocks1[1:5,2:5] [,1] [,2] [,3] [,4] [1,] 80.73 31.95 25.4 25.69 [2,] 83.66 31.95 27.12 25.2 [3,] 83.27 32.93 28.74 26.29 [4,] 83.9 34.07 29.77 26.6 [5,] 82.74 35.18 30.24 27.41 Now, why can't I convert this into a dataframe?
2004 Apr 26
1
names attribute of data.frames after rbind
Hi, If columns of a data.frame have a names attribute and we rbind two similar data.frames together, the names of the column of the resulting data.frame only has the correct values for the first component and has "" in all other positions. Is this a documented "feature" or a bug? If it is intentional, why? Here is a small example to show what I mean. The same behaviour
2013 Mar 12
1
loading data frames and rbind them
Hello everybody I have the following problem. I have to load a number of xls files from different folders (each xls file has the same number of columns, and different numbers of rows). Each xls file is named with a number, i.e. 12345.xls and is contained in a folder with same name, say 12345) Once loaded, I want to rbind all of them to obtain a single database. I think I successfully did the
2003 Apr 21
3
index after rbind
I am using rbind to concatenate two dataframes, but after the rbind I get a strange "double" index. I am using rbind a number of times to make one large dataset. Is there a way to prevent the "double" index? Or is there some other way to concatenate the data (it looks like merge only works by columns)? Here is an example of the "double" index.
2013 Jan 02
2
rbind: inconsistent behaviour with empty data frames?
The rbind on empty and nonempty data frames behaves inconsistently. I am not sure if by design. In the first example, first row is deleted, which may or may not be on purpose: df1 <- data.frame() df2 <- data.frame(foo=c(1, 2), bar=c("a", "b")) rbind(df1, df2) foo bar 2 2 b Now if we continue: df1 <- data.frame(matrix(0, 0, 2)) names(df1) <- names(df2)
2007 Mar 05
3
Rbind with data frames -- column names question
As part of my work, I am trying to append matrices onto data frames. Naively I assumed that when rbinding a data.frame and matrix, the matrix would be coerced and appended, keeping the names from the data frame. Clearly, I am not fully understanding the process by which rbind works. Example code: > A<-data.frame(1,1,1); names(A)=letters[1:3] ; B<-matrix(0,2,3) > rbind(A,B)