Displaying 20 results from an estimated 3000 matches similar to: "recursion problem using do.call(rbind, list(..,<S4>,..))"
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
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
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 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
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
2015 Feb 02
0
Proper way to define cbind, rbind for s4 classes in package
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 add an S3 method
for your class to introduce a conflict, otherwise it will dispatch to
cbind.data.frame if one of the args is a data.frame). There may no longer
be a need for cBind() and
2015 Jan 24
0
Proper way to define cbind, rbind for s4 classes in package
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
> 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
2005 Sep 13
3
NUMERIC_POINTER question
Dear R-developers,
Using .Call I pass a S4 class with e.g. the following class definition:
setClass("mmatrix",representation(
data="matrix")
)
On the "C side" i do
mat = GET_SLOT(vs,install("data"));
and then:
printf("%f\n",NUMERIC_POINTER(mat)[1]);
The above print statement produces the correct output if
xx<- new("mmatrix")
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
2016 Sep 10
3
c(<Matrix>, <Matrix>) / help(dotsMethods) etc
I have been asked (by Roger; thank you for the good question,
and I hope it's fine to answer to the public) :
> with Pi a sparse matrix and x,y, and ones
> compatible n-vectors ? when I do:
>> c(t(x) %*% Pi %*% ones, t(ones) %*% Pi %*% y )
> [[1]] 1 x 1 Matrix of class "dgeMatrix"
> [,1] [1,]
> 0.1338527
>
2018 Mar 22
0
[R-pkg-devel] Warning: rBind is deprecated
>From a small thread over at the 'R-package-devel' mailing list,
this now goes to the R-devel mailing list
(CC'ing the original R-package-devel very exceptionally).
Note that I, as maintainer("Matrix") had introduced rBind() and
cBind() to be used for Matrix package matrices as substitute for
rbind() and cbind() because back then it was not reasonably
possible to
2006 Sep 07
2
Matrix package in R-2.4.0alpha
In a newly downloaded version (today) of R-2-4-0alpha, with all packages
from CRAN also installed today, I get:
> library(Matrix)
Erro en loadNamespace(package, c(which.lib.loc, lib.loc), keep.source =
keep.source) :
in 'Matrix' methods specified for export, but none defined: BIC,
anova, coef, confint, deviance, fitted, fixef, formula, head, lmer, logLik,
mcmcsamp, plot,
2016 Sep 10
1
c(<Matrix>, <Matrix>) / help(dotsMethods) etc
>>>>> John Chambers <jmc at r-project.org>
>>>>> on Sat, 10 Sep 2016 09:16:38 -0700 writes:
> (Brief reply, I'm traveling but as per below, this is on my radar right now so wanted to comment.)
> Two points regarding "dotsMethods".
> 1. To clarify the limitation. It's not that all the arguments have to be of the same
2009 Sep 29
2
rbind for a list
Dear All,
I´m using the following code:
all1<-gg2[[1]][[1]]; for(i in 1:48){ all1 <- rbind(all1,gg2[[i]][[1]]) }
to create a new matrix that contains all the matrices in a list called gg2.
gg2 is a list that looks like
>> gg2
[[1]]
[[1]][[1]]
<matrix one>
[[2]]
[[2]][[1]]
<matrix two>
.
.
.
[[48]]
[[48]][[1]]
<matrix 48>
Is there a faster way to do the rbind?
2005 Nov 20
1
use of the 'by' command & converting SPSS ANOVA/GLM syntax into R syntax
I have two questions I would appreciate assistance with:
(1) I believe "by" is the command used to split a file. In the following
example, "mydat" is the dataframe , "group" the variable I want to split
the analysis by & "WK1FREQ,WK2FREQ" the variables
attach(mydat)
by (GROUP)
cor.test (WK1FREQ,WK2FREQ)
I have also tried: (by (GROUP) cor.test
2006 Dec 19
1
preserving sparse matrices (Matrix)
Hi,
I have sparse (tridiagonal) matrices, and I use the Matrix package for
handling them. For certain computations, I need to either set the
first row to zero, or double the last row. I find that neither
operation preserves sparsity, eg
> m <- Diagonal(5)
> m
5 x 5 diagonal matrix of class "ddiMatrix"
[,1] [,2] [,3] [,4] [,5]
[1,] 1 . . . .
[2,] . 1
2012 Sep 12
1
methods cbind2 bind_activation disrupts cbind everywhere
The methods package ?cbind2 includes the instruction to use via
methods:::bind_activation(TRUE). This changes the default definition of
cbind globally, disrupting proper evaluation in packages not using
cbind2. Is cbind2 a hold-over from a time when ... could not be used for
dispatch? What is a safe way for a package to use cbind2?
This came up in the context of complex package dependencies
2016 Sep 10
0
c(<Matrix>, <Matrix>) / help(dotsMethods) etc
(Brief reply, I'm traveling but as per below, this is on my radar right now so wanted to comment.)
Two points regarding "dotsMethods".
1. To clarify the limitation. It's not that all the arguments have to be of the same class, but there must be one class that they belong to or subclass. (So, as in the example in the documentation, the method could be defined for a class