similar to: Reference class finalize() fails with 'attempt to apply non-function'

Displaying 20 results from an estimated 10000 matches similar to: "Reference class finalize() fails with 'attempt to apply non-function'"

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 Oct 31
1
Question about copying reference objects using the initialize method
Dears, I have a question about copying reference objects using the initialize method. 1) If the latter has no arguments, there is no problem to copy an object. myClass = setRefClass("myClass", fields = list(value = "numeric") ) myClass$methods(initialize = function(...){ ? value <<- 1 ? callSuper(...) }) newObject = myClass$new() newObject$value = 2 copyObject =
2012 Jan 04
1
Is there a way to update a method on an existing Reference Class object?
Hi Being able to do object oriented programming in R is really good. I now started using the Reference Classes and really like it. Though, I have one problem: I cannot find a way to update a method on an existing object. The flexibility that scripting gives (really needed for interactive data analysis) is lost if everything have to be recalculated all the time. For example I would normally
2012 Jun 19
1
Reference classes and memory consumption
Dear All, It seems that reference classes consume a lot of memory which became a problem for my rather extensive simulation. I prepared a small example. An instance of this minimal class uses about 20K on disk. rm(list=ls(all=TRUE)); MySmallClass = setRefClass("MySmallClass", fields = list( myField = "numeric" ), methods = list( initialize =
2011 Jun 03
2
Bug or feature: using "ANY" as a generic field class (was: '[R] Is there a (virtual) class that all R objects inherit from?)
Dear list, I was wondering if you could help me out in clarifying something: Is it possible to use class "ANY" in slots/fields of formal classes if you a) do not want to restrict valid classes of that field and b) if you are making explicit use of class inheritance? It seems to work in simple scenarios but produces errors when class inheritance comes into play. So I was
2010 Aug 27
1
Error: package/namespace load failed for 'IlluminaHumanMethylation27k.db'
Hello everyone, I have a problem when loading the library: IlluminaHumanMethylation27k.db I installed the package from zip (from the Bioconductor website), and also installed all the packages it asked for. It went all succesfull: "package 'IlluminaHumanMethylation27k.db' successfully unpacked and MD5 sums checked" But when I am trying to load this library I get an error:
2012 Jan 06
0
interesting connection / finalizer bug?
This setOldClass(c("file", "connection")) .A <- setRefClass("A", fields=list(con="connection"), methods=list( finalize = function() { if (isOpen(con)) close(con) })) f <- tempdir() a <- .A$new(con=file(f, "rb")) close(a$con) a <- .A$new(con=file(f,
2011 May 04
1
General "nil" reference class object
Dear John and others, I've been wondering about whether there's any way to indicate a "nil" reference class object, which will represent "no value", and be tested for, but not fail the internal type checking. NULL is the obvious choice (or seems so to me), but can only be used if an explicit class union is created: > Foo <- setRefClass("Foo") > Bar
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 May 08
2
Error in AnnotationDbi package - makeProbePackage
Dear all, We have developed our own Affymetrix chip (Custom Express Array, PM-only with two species). I want to analyse the data with the limma package, but for that I need to built my own CDF package, probe package and built the filters to analyse one specie or another. I'm using the makeProbePackage available in the AnnotationDbi (for a R-2.13.0) but I got the following error message:
2010 Nov 15
1
SEXP and slots
Hello, Since people have whisperred about Rcpp, I'd like to play too. > On 11/15/2010 07:45 AM, Patrick Leyshock wrote: >> Very helpful, thank you. >> >> A couple other questions, please: >> >> 1. I've got a function written in C, named "my_c_function". In my R >> code I call this function, passing to it an INTSXP and a STRSXP, >>
2014 Feb 21
0
instantiating a reference class with an initialize() method from .onLoad fails
PkgA has a single R/binding.R file containing .A <- setRefClass("A", methods=list(initialize=function(...) {})) .onLoad <- function(...) .A() A NAMESPACE with import(methods) exportClasses("A") and DESCRIPTION Package: PkgA Type: Package Title: Documenting reference classes Version: 0.0.1 Date: 2012-08-05 Author: Martin
2010 Oct 22
1
Reference classes
Dear all, First, many thanks to John Chambers, and anyone else who was involved, for the new support for "reference classes" in R 2.12.0. It's nice to see this kind of functionality appear in a relatively R-like form, and with the blessing of the core team. In some contexts it is undoubtedly appealing to associate a set of methods with a class directly, rather than defining a load
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
2008 May 30
1
NAMESPACE & methods guidance, please
My conception of how NAMESPACE and methods in R-2.7.0 resolved a generic 'func' to a func-method was to search as follows: In 2.7.0: func --> NAMESPACE, including Imports: (and other details) --> .GlobalEnv, and eventually Depends: since these are on search() In R-devel it seems like func --> NAMESPACE, including Imports: (and other details) --> ?? but not
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
2008 May 19
1
RSQLite and undefined symbol:sqlite3_bind_in
Hi All, I tried to install AnnotationDBI like so: source("http://bioconductor.org/biocLite.R") biocLite("AnnotationDbi") and got this error: .... Loading required package: RSQLite Error in dyn.load(file, ...) : unable to load shared library '/RHEL3/local/lib64/R/library/ RSQLite/libs/RSQLite.so': /RHEL3/local/lib64/R/library/RSQLite/libs/RSQLite.so: undefined
2010 Oct 28
2
Reference Classes: Generalizing Reference Class Generator objects?
Is it possible to override the $new(...) in the reference class generator? I have tried adding a "new" method to the methods of the class, but that is obviously not correct. I have also tried adding it to the class generator, but the class generator still uses the default constructor. As a simple example, this is the current interface: TestClass <- setRefClass
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,
2008 Oct 08
1
follow up on "[Rd] NAMESPACE & methods guidance, please" ( http://tolstoy.newcastle.edu.au/R/e4/devel/08/06/1901.html )
This is a follow-up on the discussion originally posted on the R-devel list ( http://tolstoy.newcastle.edu.au/R/e4/devel/08/06/1901.html ), as I have encountered the exact same issue mentioned in Martin's email. Here is a simplified version of my problem: ##================================================================= ## I created a package, say, "tmpA", with a NAMESPACE with