Displaying 20 results from an estimated 100 matches similar to: "package.skeleton generates ".env = <environment>""
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",
Suggestion for exception handling: More informative error message for "no applicable method..." (S3)
2009 Oct 20
1
Suggestion for exception handling: More informative error message for "no applicable method..." (S3)
I'd like to suggest that whenever there is no S3 method implementation
available for a particular class, that the error message would also
report the class structure of the object dispatched on.
Example:
foo <- function(...) UseMethod("foo")
foo.ClassA <- function(object, ...) { cat("foo() for ClassA called.\n") }
> foo(structure(1, class="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
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 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",
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
2010 Jan 05
5
[LLVMdev] [Help] How can we call an object's virtual function inside IR?
Dear experts,
I am learning llvm by reading documents and have a question to ask.
The following is the example of code generation that I created.
[[a [10.00]] > [3.00]]
; ModuleID = 'ExprF'
define i1 @expr(double* %record) {
entry:
%0 = getelementptr double* %record, i32 0 ;
<double*> [#uses=1]
%1 = load double* %0 ; <double>
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
2006 Apr 08
7
text_field and arrays
Hi,
I''m trying to do a bulk update on an array with the helper text_field.
I''m trying to create an inputfield for every object in the array, but
I''m not getting it right...
example:
class ClassA
@arrayB[]
end
HTML (code with error):
<% 0.upto(9) do |index| %>
<%= text_field ''ClassA'', ''arrayB[index]'' %>
non
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"),
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
2010 Jan 06
0
[LLVMdev] [Help] How can we call an object's virtual function inside IR?
Hi Gyounghwa Kim,
> First of all, thank you very much for your answer.
> I tried your sugestion and found out that it is not what I wanted.
> What I have to do is call a native C function from inside this
> generated function.
> Is there any way that we can find and call native C functions not
> created by LLVM IR?
You can insert a declaration of the function into the IR, then
2002 May 21
4
setClass() and packages
Where should the setClass() ('methods' package) calls be placed in a
package? I try to follow a one-class-one-file principe, but since
setClass("ClassA", "ClassB") has to come a after setClass("ClassB", [snip])
it is not possible to fully follow this rule. So the best I can do now is to
put all setClass() calls in a file named "000.R" (I know this
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
2007 Feb 04
2
Problem using ofstream in C++ class in package for MacOS X
Dear all,
I am currently learning how to create R packages using C++ classes.
For this purpose I have written a small package MyClass (which I try
to attach since I do not have access to a website).
MyClass has methods WriteFileC() and WriteFileCpp() which implement
C-style and C++-style writing of a table to a file using FILE or
ofstream respectively, and the corresponding R-functions
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
>>
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
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