Displaying 20 results from an estimated 50000 matches similar to: "cbind speed."
2007 Mar 20
1
cbind() & rbind() for S4 objects -- 'Matrix' package changes
As some of you may have seen / heard in the past,
it is not possible to make cbind() and rbind() into proper S4
generic functions, since their first formal argument is '...'.
[ BTW: S3-methods for these of course only dispatch on the first
argument which is also not really satisfactory in the context
of many possible matrix classes.]
For this reason, after quite some discussion on
2003 Jul 29
2
cbind/rbind inconsistency with NULL parameter (PR#3585)
R-Version: 1.7.1 (2003-06-16)
OS: Debian/GNU Linux
cbind and rbind handle NULL parameters inconsistently.
Consider:
> cbind()
NULL
> cbind(NULL)
NULL
And:
> cbind(diag(x = 1, 1, 1))
[,1]
[1,] 1
> cbind(NULL, diag(x = 1, 1, 1))
[,1]
[1,] 1
These seem to indicate that NULL parameters will be ignored in any call to
cbind and rbind. However:
>
2015 Jan 26
2
Proper way to define cbind, rbind for s4 classes in package
>>>>> Michael Lawrence <lawrence.michael at gene.com>
>>>>> on Sat, 24 Jan 2015 06:39:37 -0800 writes:
> On Sat, Jan 24, 2015 at 12:58 AM, Mario Annau
> <mario.annau at gmail.com> wrote:
>> Hi all, this question has already been posted on
>> stackoverflow, however without success, see also
>>
2015 Jan 24
3
Proper way to define cbind, rbind for s4 classes in package
Hi all,
this question has already been posted on stackoverflow, however without
success, see also
http://stackoverflow.com/questions/27886535/proper-way-to-use-cbind-rbind-with-s4-classes-in-package.
I have written a package using S4 classes and would like to use the
functions rbind, cbind with these defined classes.
Since it does not seem to be possible to define rbind and cbind directly
as S4
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
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
2009 Mar 15
1
cbind(NULL,zoo.object)?
Folks,
I often build up R objects starting from NULL and then repeatedly
using rbind() or cbind(). This yields code like:
a <- NULL
for () {
onerow <- craft one more row
a <- rbind(a, onerow)
}
This works because rbind() and cbind() are forgiving when presented
with a NULL arg: they act like nothing happened, and you get
all.equal(x,rbind(NULL,x)) or all.equal(x,cbind(NULL,x)).
2006 Sep 27
1
S3 methods for cbind/rbind
I created a type of object similar to a data frame. In some circumstances, It
needs special methods for "[" and "[<-" and rbind() (but not cbind()). Then I
found this in the cbind()/rbind() man page:
The method dispatching is _not_ done via 'UseMethod()', but by
C-internal dispatching. Therefore, there is no need for, e.g.,
'rbind.default'.
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
2011 Aug 10
1
rbind/cbind
Dear list,
I wonder if there a better way to have rbind/cbind/append to create
the first element (if it is empty) instead of doing the following in a
loop?
for (i in 1:10) {
if (i == 1) {
aRow = SomeExpression(i)
} else {
aRow = rbind(aRow,SomeExpression(i))
}
}
Thanks
Anthony
2005 Aug 22
1
cbind and rbind
Hi, I have been trying for a while to use cbind and rbind to add a row and column to the same table but seem to be able only to add one OR the other???
Any help would be most welcome,
Tony Evans
Australia
[[alternative HTML version deleted]]
2010 Jan 29
2
cbind, row names
Hello,
I read the help as well as the examples, but I can not figure out why
the following code does not produce the *given* row names, "x" and "y":
x <- 1:20
y <- 21:40
rbind(
x=cbind(N=length(x), M=mean(x), SD=sd(x)),
y=cbind(N=length(y), M=mean(y), SD=sd(y))
)
Could you please help?
Thank you
S?ren
2004 Mar 26
4
cbind/rbind fail on matrixes containing lists (PR#6702)
Today's R 1.9.0 beta:
> m1
[,1] [,2] [,3] [,4]
[1,] NA NA NA NA
[2,] NA NA NA NA
[3,] NA NA NA NA
[4,] NA NA NA NA
> class(m1[1,1])
[1] "list"
> cbind(m1,m1)
Error in cbind(...) : cannot create a matrix from these types
> rbind(m1,m1)
Error in rbind(...) : cannot create a matrix from these types
> version
_
2009 Oct 02
2
how to fill out the empty spots when using rbind or cbind?
I have uneven vectors I want to use cbind or rbind to combine them into a matrix. Is there a way to make it so that R would not return error msg saying they're uneven?
Thanks.
Edward Chen
Email: tkedch@msn.com
Cell Phone: 510-371-4717
[[alternative HTML version deleted]]
2011 Jul 04
1
[R-SIG-Finance] FinCenter in timeSeries with "merge", "cbind" and "rbind"
Hi R users:
When I try to merge or bind (cbind or rbind) two series,
both with a "FinCenter" different that GMT, the
result is "GMT" not the original financial center?
What am I doing wrong?
######################################################
require(timeSeries)
getRmetricsOptions("myFinCenter")
setRmetricsOptions(myFinCenter = "America/Bogota")
2005 Oct 21
1
Generalised rbind/cbind
Dear list,
Is there a generalised form of rbind/cbind for combining
matrices/arrays into higher-D structures? ie. if I have:
a <- matrix(2,2,2)
b <- matrix(3,2,2)
how can I get
array(rep(c(3,2), each=4), c(2,2,2))
?
It seems like this would be the job of a generalised abind function:
abind(a,b, along=1) == rbind(a,b)
abind(a,b, along=2) == cbind(a,b)
abind(a,b, along=3)
2008 Mar 13
2
How to cbind or rbind different lengths vectors/arrays without repeating the elements of the shorter vectors/arrays ?
Hi,
How to cbind or rbind different lengths vectors/arrays without repeating the
elements of the shorter vectors/arrays ?
> cbind(1:2, 1:10)
[,1] [,2]
[1,] 1 1
[2,] 2 2
[3,] 1 3
[4,] 2 4
[5,] 1 5
[6,] 2 6
[7,] 1 7
[8,] 2 8
[9,] 1 9
[10,] 2 10
[[alternative HTML version deleted]]
2011 Feb 06
1
Applying 'cbind/rbind' among different list object
Hi, I am wondering whether we can apply 'cbind/rbind' on many **equivalent**
list objects. For example please consider following:
> list1 <- list2 <- vector("list", length=2); names(list1) <- names(list2)
<- c("a", "b")
> list1[[1]] <- matrix(1:25, 5)
> list1[[2]] <- matrix(2:26, 5)
> list2[[1]] <- 10:14
> list2[[2]] <-
2005 Dec 06
1
Help on a matrix task
Hello,
Being new to R, I am completely stuck with the following problem. Please
help to find a general solution to the following matrix task:
Given:
N<-4
input_mat<-matrix(c(1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0,
1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0,
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0),ncol=N)
2008 Dec 22
2
... (dotMethods) and cbind/rbind: how to give the signature?
Dear List,
I'm struggling with the signature writing cbind/rbind functions for a S4
class.
First of all, I'm very happy that it is now possible to dispatch on ...
I follow the example for "paste" in ?dotMethods, which works as far as this:
### start example
setClass ("cbtest",
representation = representation (data = "data.frame"),