Displaying 20 results from an estimated 5000 matches similar to: "Reference classes: error with missing arguments in method calls"
2011 Mar 07
1
WG: Reference classes: error with missing arguments in method calls
Dear list,
a while ago I posted this at r-devel but got no answers. Hope it?s okay to
give it a shot again by cross-posting it here.
TIA for any comments,
Janko
Von: Janko Thyson [mailto:janko.thyson.rstuff at googlemail.com]
Gesendet: Montag, 21. Februar 2011 00:58
An: r-devel at r-project. org (r-devel at r-project.org)
Betreff: Reference classes: error with missing arguments in method calls
2011 May 26
0
Reference Classes: strange behavior when trying to change class def in the same R session
Dear list,
I'm getting some strange behavior with Reference Classes every once in a
while and I can't really put my finger on the cause. It'd be great if
someone using Reference Classes could check if he/she experiences
similar problems:
The thing is that when I alter the definition of a Reference Class in a
running R session and source the respective file containing the class
2011 Jun 29
1
Ref Classes: bug with using '.self' within initialize methods?
Dear list,
I'm wondering if the following error I'm getting is a small bug in the
Reference Class paradigm or if it makes perfect sense.
When you write an explicit initialize method for a Ref Class, can you
then make use of '.self' WITHIN this initialize method just as you would
once an object of the class has actually been initialized?
Because it seems to me that you can not.
2010 Nov 17
2
Reference classes: accessor functions via 'getRefClass(...)$accessors(...)'
Hi there,
I''d like to choose between an "static" and "dynamic" access of a reference
class field, say ''a''.
myObj <- getRefClass("Blabla")$new()
Static: myObj$a
Dynamic: myObj$a.get() where the function retrieves the data
from a database (or some other location), stores it to a buffer and
2011 May 26
0
Reference Classes: getter and setter functions/methods and possible shortcuts
Hi everyone,
just wanted to ask what's the smartest/recommended way of defining
getter and setter function *shortcuts* (i.e. something like "[", "[<-")
for Reference Class objects?
Or is it desired to not use this stuff, but define methods like
'obj$getSubset(row=1:3, col=1)' and 'obj$setSubset(value=x)' instead?
I have some example code that might
2010 Nov 23
1
Reference Classes: removing methods -> implications for objects/instances of that class
Dear list,
just to make sure that I understand 'unregistering' methods for S4 reference
classes correctly:
If I registered a method and want to 'unregister' (i.e. remove) this method
again, objects/instance created of the respective class still feature the
removed method until I do an explicit reassign ('my.instance <-
getRefClass("Classname")$new()'), right?
2011 Jun 06
1
Reference Classes: shortcut like 'isS4' for Ref Classes?
Dear list,
is there a shortcut-function to check whether a class is a Reference
Class or not? There's something like this for S4 classes
('isS4(object)'), but I couldn't find anything regarding Ref Classes.
Currently, I'm doing it this way, which is a bit clumsy:
A <- setRefClass("A", fields=list(X="numeric"))
a <- A$new()
isRefClass <-
2011 Feb 03
2
Creating a reference class object from a class definition in a package fails
Hi,
I'm trying to create a package that contains reference class
definitions from which users can create reference objects, but there
seems to be something awry.
My toy example creates an empty package via
package.skeleton('TestClass') to which I add the following R code:
TestClass <- setRefClass('TestClass',fields=c('name'))
Unfortunately my R console output
2010 Nov 24
2
Reference Classes: how to clone/copy instances?
Dear list,
I don't know what's the correct term for this in the OOP context, but is it
possible to "clone"/copy an instance of a reference class (say 'a') so that
I get an *autonomous* second instance 'b'? Autonomous in the sense that
changes to 'a' do not affect 'b'.
I know that this is somewhat against the pass-by-reference paradigm, but the
2012 Oct 27
2
Class generator functions for reference classes
As of rev. 61035 in r-devel, setRefClass() now returns a generator
function, as setClass() has done since 2.15.0.
The convenient style is now:
mEdit <- setRefClass("mEdit",......)
xx <- mEdit(data = xMat)
instead of
xx <- mEdit$new(data = xMat)
The returned object still has fields and methods accessible as before.
See the "Value" and "Reference Class
2011 Aug 30
1
Why does loading saved/cached objects add significantly to RAM consumption?
Dear list,
I make use of cached objects extensively for time consuming computations
and yesterday I happened to notice some very strange behavior in that
respect:
When I execute a given computation whose result I'd like to cache (tried
both saving it as '.Rdata' and via package 'R.cache' which uses a own
filetype '.Rcache'), my R session consumes about 200 MB of
2010 Nov 17
0
Reference classes: opinion on OOP design
Dear list,
I'm aware that this post does not really comply with the posting guide with
respect to "providing a minimal reproducible code example". But I do hope
it's okay that I spared uninterested readers by putting that into the
attachment ;-)
The thing is that I'm not really familiar with "true" OOP as R is my first
programming language. So I wanted to ask
2010 Nov 17
0
WG: Reference classes: opinion on OOP design
Sorry, never sent an attachment before. I think my .R file didn't pass, so
I'm attaching a .txt instead.
-----Urspr?ngliche Nachricht-----
Von: Janko Thyson [mailto:janko.thyson at ku-eichstaett.de]
Gesendet: Mittwoch, 17. November 2010 19:56
An: 'r-devel at r-project. org'
Betreff: Reference classes: opinion on OOP design
Dear list,
I?m aware that this post does not really
2011 May 27
1
Reference Classes/S4 Classes: can method dispatch check superclasses BEFORE resorting to method for "ANY"?
Dear list,
is it possible that method dispatch checks for superclasses/virtual
classes before checking "ANY"?
I'd like to build a generic initialization method for all my Reference
Class (say "MyDataFrame") objects by having them inherit from class, say
"MyRefClassVirtual" (which would have to be a virtual S4 class; there
are no virtual Reference Classes,
2009 Dec 15
1
S4 dispatch and S3 "connection" objects
Hello,
I'm trying to get S4 dispatch on S3 "connection" objects.
So I do :
setOldClass( "connection" )
and then :
setGeneric( "bling", function(object) standardGeneric( "bling" ) )
setMethod( "bling", "connection", function(object) cat( "gotcha ",
as.integer(object), "\n" ) )
but I get :
f <- file(
2011 May 04
1
Reference Classes: replacing '.self' with an .Rda image of '.self' from within a method? (was replacing '.self' with an .Rda image of '.self' from within a method?)
Sorry guys,
but I chose a really stupid name before (no "reference classes").
Hope it's okay to re-post.
Cheers,
Janko
>>> ORIGINAL MESSAGE <<<
Dear list,
Is it possible to update or reassign '.self' with an image of '.self'
(e.g. a locally stored .Rda file) from within a method?
I know that this might sound akward, but here's the use
2011 Mar 10
1
Testing for a reference class object
Hi all,
I've constructed the following function to test whether or not an
object was created from a reference class:
isRefClassObject <- function(x) isS4(x) &&
is.environment(attr(x,'.xData')) &&
exists('.refClassDef',attr(x,'.xData'))
but I'm unsure if it's a complete test or if there's a better way to
test. Regardless, It would be
2005 Jul 20
1
Default arguments for setMethod() (PR#8021)
Full_Name: Bert Gunter
Version: 2.1.1
OS: Windows 2000
Submission from: (NULL) (192.12.78.250)
There appears to be either a bug or documentation problem in
setMethod/setGeneric with how default arguments are handled. The setMethod Help
says:
******
Method definitions can have default expressions for arguments. If those
arguments are then missing in the call to the generic function, the default
2010 Nov 21
1
reference classes: question on inheritance
Dear list,
I have a reference class which should act as a "generic" superclass for
other classes. I've read the respective section at ?setRefClass and put the
name of the superclass to the 'contains' argument of an example subclass
(see class defs below). Classnames are set in a way that shouldn't result in
collation issues (virtual def sourced before superclass def
2011 Jun 01
1
possibly invalid assertion in setRefClass?
> setRefClass("Foo", fields = list())
Error in setRefClass("Foo", fields = list()) :
A list argument for fields must have nonempty names for all the fields
In my opinion, the above should not fail. There are no fields.
Thanks,
Michael
[[alternative HTML version deleted]]