Displaying 20 results from an estimated 3000 matches similar to: "setClass() and packages"
2011 Aug 26
1
R.oo data members / inheritance
If someone is able, can you tell me if there is a better way to do this?
More specifically, do I have to rewrite all of the data members stuff and
extend stuff of parent class in the child class? See below. Thanks in
advance!
Example 1:
setConstructorS3("ClassA", function(A,x) {
if(missing(A))A=15;
if(missing(x))x=NA;
extend(Object(), "ClassA",
.size = A,
.x=x
2008 Nov 05
1
Methods dispatch and inheritance R.oo
Hi to all members, i have a question about class inheritance and methods
using R.oo package:
I have the following code and it doesn't work, guess i'm doing smth wrong
and there is nothing in the help.
library(R.oo)
setConstructorS3("ClassA", function(A=15) {
extend(Object(), "ClassA",
.size = A
);
})
setMethodS3("print", "ClassA",
2009 Jul 07
2
[LLVMdev] How to add an include file
Hi Eli,
Let's say I have a file ClassA.h, that pairs with a file ClassA.cpp
to product a library libClassA.a.
ClassA.h contains the single declaration.
class A {...};
I want to transform it to:
#include "ClassB.h"
class A : public class B {...};
ClassB.h is the header file for a library libClassB.a built from ClassB.cpp
and ClassB.h.
I can clearly link libClassB with libClassA.
2009 Jul 07
0
[LLVMdev] How to add an include file
On Tue, Jul 7, 2009 at 1:42 AM, David Minor<dahvid.minor at gmail.com> wrote:
> Hi Eli,
> Let's say I have a file ClassA.h, that pairs with a file ClassA.cpp
> to product a library libClassA.a.
> ClassA.h contains the single declaration.
>
> class A {...};
>
> I want to transform it to:
>
> #include "ClassB.h"
>
> class A : public class B
2011 Jun 23
1
Class not found when search in .onLoad
Hi,
I am facing with a strange behaviour of isClass and extends when these
are called in .onLoad in both R 2.12.1 and R 2.13.0. This is preventing
my package from doing some object initializations at a proper place
(i.e. in .onLoad).
Suppose one defines two S4 classes in a package, and that one needs to
check the inheritance between these two when loading the package (e.g.
to validate slots
2003 Oct 02
1
"[[<-","[[" default?
Hi!
I have implemented class specific behaviour of "[[<-.myclass"<-function().
How it is posible to call the "[[.default" on an object of myclass?
Eryk
Dipl. bio-chem. Eryk Witold Wolski @ MPI-MG Dep. Vertebrate Genomics
Ihnestrasse 73 14195 Berlin 'v'
tel: 0049-30-84131285 / \
mail: wolski@molgen.mpg.de ---W-W----
2009 Jul 05
0
[LLVMdev] How to add an include file
On Sun, Jul 5, 2009 at 1:16 PM, David Minor<dahvid.minor at gmail.com> wrote:
> I'm writing a code transformation that involves adding an include to
> existing code, adding a base class
> to and existing class and then linking with a previously compiled library.
> The main problem for me
> seems to be how can I add the include? Can I compile the include alone to
> byte
2009 Jul 05
2
[LLVMdev] How to add an include file
I'm writing a code transformation that involves adding an include to
existing code, adding a base class
to and existing class and then linking with a previously compiled library.
The main problem for me
seems to be how can I add the include? Can I compile the include alone to
byte code and pre-pend it?
Should I compile the library, which includes the include and parse out the
include and
2003 Sep 18
1
2 time dependend states and probability transition matrix
Hi,
have got anybody experience or a starting
point for me, how i can program a function
which calculate me a probability transition matrix with a data.frame and two states.
I have some independend variable and a class variable
for two states - in example one from Jan2003 and the same variables from June2003.
Now i would like to calculate the probability that PERSON X change
from classA to
2007 Jul 12
11
Problem with "defined" keyword
Hi,
I''m running Puppet 0.23.0 on my servers, and i got something like this:
In a classa.pp file (included in site.pp):
class A {
file { "test1":
...
}
}
In a classb.pp file (included in site.pp):
class B {
file { "test2":
...
}
if defined(File["test1"]) {
... do things ...
}
if
2010 Nov 10
1
S4 package warning
Hello everyone. R-2.12.0, suse linux 11.3.
I am debugging a package that uses S4 methods
and R CMD check gives the following warning:
> Warning in methods::findMethods(g, env) :
> non-generic function 'mdm' given to findMethods()
> See the information on DESCRIPTION files in the chapter 'Creating R
> packages' of the 'Writing R Extensions' manual.
I
2011 Aug 18
0
Call super methods from inherited classes R.oo
Hi R-community,
I'm very busy with a software project which I would like to development
completely with R.oo. Many of the object oriented aspects that I already
know from Java development seems to be in place with this library.
But...there is something that I'm really missing... *the super method call*
Just a little example that shall demonstrate what I mean:
Image we have the following
2009 Jul 08
1
[LLVMdev] How to add an include file
I see,
Adding includes is trivial even w/o llvm, but the real problem here is
manipulation of classes, if I understand you correctly adding an inheritee
wouldn't be possible.
David
On Tue, Jul 7, 2009 at 12:43 PM, Eli Friedman <eli.friedman at gmail.com>wrote:
> On Tue, Jul 7, 2009 at 1:42 AM, David Minor<dahvid.minor at gmail.com> wrote:
> > Hi Eli,
> > Let's
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"),
2005 Dec 29
1
trouble with S4 methods for group "Summary"
Hello. This question concerns the Methods package. I have created a
new class and am trying to set a method for it for S4 group generic
"Summary". I have run into some signature problems. An example:
> setClass("track", representation(x="numeric", y="character"))
[1] "track"
> setGeneric("max", group="Summary")
2009 Mar 18
1
Why S4 methods of S3 'base' generics are not used in 'base' functions ?
Dear list,
It seems that S4 methods defined for an S3 'base' generic
are not used in 'base' functions.
This can be problematic when 'base' functions start with
something like 'as.matrix'.
### START R code
setClass("classA", contains = "matrix",
representation(realData = "numeric"))
setMethod("as.matrix",
2019 Nov 11
2
Troubles using numeric in s4 class union
Hi all,
I came across an issue in using the Matrix package which made it that I
could only subset Matrices using the numeric class, but could not using
integers. Steps to reproduce the problem:
library(Matrix)
# this class has *nothing* to do with Matrix
setClass("MyClass",
representation(myvalue = "numeric"),
prototype(myvalue = NA_real_))
# this class also has
2009 Aug 17
2
S4 Generics and NAMESPACE : justified warning ?
Dear list,
It seems that a package (pkgB) using another package (pkgA) with S4
generics formed by taking existing functions (for example 'plot') must
not import the existing functions ('plot') in its namespace to avoid
the warning "replacing previous import: plot".
Suppose we use the simple 'import' directive in the name space of
pkgB.
pkgA and pkgB files would
2010 Aug 18
1
Automatically retrieve correct collation
Dear List,
consider the following scenario:
setClass(Class = "A", representation = representation(B = "B", C = "C"))
setClass(Class = "B", representation = representation(C = "C"))
setClass(Class = "C", representation = representation(something =
"character"))
Obviously, the collation for sourcing these defs needs to be: C,
2010 Feb 02
1
S4 setClass / initialize misunderstanding
Hi, I recently ran into this problem. I couldn't find any mention of it in
the setClass documentation.
setClass("Foo", representation(file = "character"))
setMethod("initialize", "Foo", function(.Object, file) {
print(file)
})
setClass("Bar", contains = "Foo")
And the error:
Error in print(file) : argument "file" is