Displaying 20 results from an estimated 200 matches similar to: "R.oo modify an object inside another classes method"
2011 Aug 26
0
R.oo inheritance with pass by reference
I thought I would post an example of using R.oo with inheritance and pass by
reference for future searches. With PerMore I am inheriting Person. Then I
am changing an object data memeber of an object of PerMore class using pass
by reference ('mimiced' by R.oo) in an object of AgeMultiplier. I change a
data member in the child class and the parent class for demonstration
purposes. This is
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
2011 Sep 22
1
R.oo: do work on data member at construction
Hello,
I'd like to 'do work' on data members upon construction (i.e. without
implementing it in a get method). Is this the best way to create data member
'z' upon construction? I'm thinking if .z=paste(x,y) below gets more complex
I'll run into issues.
setConstructorS3("MyClass", function(x=NA,y=NA,...) {
this <- extend(Object(), "MyClass",
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",
2008 Oct 24
1
Help regarding oo package
Hi Henrik,
I'm sorry to be bothering you, but there is something that I have been
stuck with for a while now.
I am trying to create a class like :
setConstructorS3("MyPTCM",function(tokenslist=0)
{
extend(Object(), "MyPTCM",
.gamma = 0.0,
.rho = 0.0,
.phi = 0.0,
.tokenslist = tokenslist,
.uniquetokens = unique(tokenslist),
2011 Oct 27
0
R.oo package, inherit two classes
Hello,
How do I inherit two classes using the R.oo package. Below is kind of a
silly example, but I am trying to create class PerDog from classes Dog and
Person. Error at bottom. I've tried a few other ways of using extend(), but
nothing seems to get me what I want.
Example:
setConstructorS3("Person", function(age=NA) {
this = extend(Object(), "Person",
.age=age
)
2005 Jul 08
2
R.oo static field
How can I define a static member of a class? not a static method,
rather a static field that would be accessed by all instances of the
class.
2003 Oct 27
1
Difficulties with R.oo (static fields, etc.)
I would like to use R.oo and tcltk to implement a Turtle World. I have
encountered
many problems because:
1) I am not sure how to implement static fields with R.oo
2) I am not sure how to implement a constructor that would
call a function only for the first instance of a class (i.e., to
initialize
value of static fields only once)
3) I am not sure how to remove/delete cleanly existing
2011 Jun 16
1
Question about R.oo package
Dear R.oo package users,
while testing some functionality of the R.oo, I found that during the first construction of a object from a class, the constructor is twice called, but only one object is finalized.
In all subsequent creation processes, the constructor is (expectedly) called once.
Here some example code:
library(R.oo)
setConstructorS3("Test_class",function(val) {
2003 Jun 19
2
Newage/World music stream
Just to let everyone know I'm now broadcasting an IceCast2 Ogg Vorbis stream
of my LPFM station courtesy of MediaCast1 (http://www.mediacast1.com) for 10
hours a day Monday to Friday 20:00 - 08:00 GMT.
Newage, World, Folk, Easy Listening format. 40kb/s mono.
Regards,
Ross Levis
http://soulfm.stationplaylist.com
http://winvorbis.stationplaylist.com
http://www.stationplaylist.com
--- >8
2007 Jan 17
3
R.oo Destructors
Has anyone figured out how to create a destructor in R.oo?
How I'd like to use it: I have an object which opens a connection thru RODBC
(held as a private member) It would be nice if the connection closes automatically
(inside the destructor) when an object gets gc()'ed.
Thanks in advance.
Regards,
Ken
BTW, a >BIG< thanks to Henrik Bengtsson for creating the R.oo package!
Lucky
2008 Mar 06
1
Argument "nomatch" matched by multiple actual arguments ... %in% -> match?!?
When I run R CMD check R.oo on R v2.7.0 devel (2008-03-04 r44677) on
WinXP I get the following error while testing examples:
Error in match(x, table, nomatch = 0) :
formal argument "nomatch" matched by multiple actual arguments
Calls: setMethodS3 -> setMethodS3.default -> %in% -> match
Execution halted
How is that even possible with:
> get("%in%")
function (x,
2007 Dec 07
1
Make natural splines constant outside boundary
Hi,
I'm using natural cubic splines from splines::ns() in survival
regression (regressing inter-arrival times of patients to a queue on
queue size). The queue size fluctuates between 3600 and 3900.
I would like to be able to run predict.survreg() for sizes <3600 and
>3900 by assuming that the rate for <3600 is the same as for 3600 and
that for >4000 it's the same as for
2016 Apr 02
1
[Bug 1061] New: net-firewall/nftables-0.5-r2: limit rate: burst parameter doesn't work
https://bugzilla.netfilter.org/show_bug.cgi?id=1061
Bug ID: 1061
Summary: net-firewall/nftables-0.5-r2: limit rate: burst
parameter doesn't work
Product: nftables
Version: unspecified
Hardware: x86_64
URL: http://wiki.nftables.org/wiki-nftables/index.php/Rate_
limiting_matchings
2004 Aug 06
5
Icecast deadlock with 1.3.12 (fixed)
Folks-
First, let me submit a disclaimer... I know 1.3.12 is unsupported.
However, since icecast2 isn't officially released, I'm abit SOL anyways,
so I'm currently trying to debug it and will release a patch when I'm
done. (Which I'm doing since the code is GPL and I want to
contribute... if no one cares, let me know and I'll stop updating the
list with what i find)
2010 Oct 15
1
Package 'nlme' fails 'make check-all' in R 2.12.0 patched built from source
Hi all,
I am building R 2.12.0 patched this morning from source on Snow Leopard (10.6.4). In fact, three times now, with separate clean source and build directories each time, just to be sure that the issue is predictable.
I would be happy to have somebody tell me that I am missing something fundamental here also...
After running make check-all, I get the following error for 'nlme':
*
2016 Mar 05
2
[Bug 1054] New: SYNPROXY
https://bugzilla.netfilter.org/show_bug.cgi?id=1054
Bug ID: 1054
Summary: SYNPROXY
Product: nftables
Version: unspecified
Hardware: x86_64
OS: All
Status: NEW
Severity: enhancement
Priority: P5
Component: kernel
Assignee: pablo at netfilter.org
Reporter:
2011 Oct 24
0
R.oo package: do setMethodS3 work upon construction
Hello (Heinrich),
I did not know I could do this. It doesn't seem to be documented anywhere.
Thought this would be helpful to the fraction of the community using package
R.oo. Note the call of a setMethodS3 method, xOne, in the setConstructorS3.
This is extremely useful if xOne (in this case) is a very complex method
(that you always want to be called every time you create a new object). If I
2010 Jan 20
1
R.oo installation warnings?
I got the following warnings when I install R.oo. Are these warnings
normal? Should I reinstall the package as mentioned in the warnings?
How to reinstall? The sessionInfo() is at the end.
> install.packages("R.oo", dependencies=T)
Warning in install.packages("R.oo", dependencies = T) :
argument 'lib' is missing: using '/utility/R'
also installing the
2009 Oct 26
3
R.oo and S4?
There are different way to make R classes. I know R.oo and S4. I'm
wondering which one is the current popular one. Which one is current
recommended when make new R packages? Thank you!