Displaying 20 results from an estimated 900 matches similar to: "using trace() on S4 coerce method"
2008 Aug 20
1
acts_as_ferret and DRb server errors
I am seeing this in my ferret_server.log when I do a search:
DRb server: ensure_index_exists for class Myclass1
DRb server: ensure_index_exists for class Myclass2
DRb server: ensure_index_exists for class Myclass3
DRb server: ensure_index_exists for class Myclass4
#method_missing(:id_multi_search, ["Myclass1", "test*", ["Myclass4",
"Myclass3",
2011 Aug 19
0
retain class after merge
Dear All,
is there a simple way to retain the class attribute of a column, if
merging two data.frames?
When merging the example data.frames form help(merge) I am unable to
keep the class attribute as set before merging (see below).
Two columns are assigned new classes before merge (myclass1,
myclass2), but after merge the resulting column has class "character".
best regards,
Heinz
2007 Apr 15
0
as() creates invalid entries in methods list?
Hi,
We've observed rather strange behavior related to as(). When as() is
used to make a conversion to a super class, an invalid entry is
inserted into the table of methods.
> setClass("A", contains="list")
> get(".MTable", environment(coerce))[["list#A"]]
NULL
> as(list(), "A")
> get(".MTable",
2006 May 14
1
bindingIsLocked returns illogical logical
bindingIsLocked applied to a locked binding returns a 'logical' that
is niether true nor false.
Martin
> e <- new.env()
> e$x <- 1
> e$y <- 2
> lockBinding("x", e)
NULL
> bindingIsLocked("x", e)
[1] TRUE
> bindingIsLocked("x", e)==TRUE
[1] FALSE
> bindingIsLocked("x", e)==FALSE
[1] FALSE
>
2014 Oct 02
3
debuggingState() analogous to tracingState() ?
We have had some conversation within R core,
lead by Duncan Murdoch and me, about a proposal
to extend the current tracingState() functionality
by something tentatively called debuggingState().
Duncan has allowed me to copy the previous conversation
(after very minor editing):
The following is quite technical and assumes you know more about
R's debug()ing and trace()ing than an estimated
2012 Aug 05
2
setMethod sometimes fails to set package slot when signature has trailing 'ANY'
after this
setClass("A")
setGeneric("bar", function(x, y) standardGeneric("bar"))
setMethod(bar, signature(x="A", y="A"), function(x, y) {})
setMethod(bar, signature(x="A", y="ANY"), function(x, y) {})
the method for signature c("A", "A") contains package information
> str(getMethod(bar,
2011 May 31
1
assignInNamespace and new bindings
Hello,
assignInNamespace refuses to assign an object to a name that is not
already used in the namespace.
Something like this would make it possible:
--- src/library/utils/R/objects.R (revision 56024)
+++ src/library/utils/R/objects.R (working copy)
@@ -252,8 +252,9 @@
stop("environment specified is not a package")
ns <- asNamespace(substring(nm, 9L))
2005 Nov 14
1
Tidiest way of modifying S4 classes?
I wish to make modifications to the plot.pedigree function in the
kinship package. My attempts to contact the maintainer have been
unsuccessful, but my question is general, so specifics of the kinship
package might not be an issue.
My first attempt was to make a new function Plot.pedigree in the
.GlobalEnv which mostly achieved what I wanted to. However, I'm sure
that's not the tidiest
2012 Aug 03
1
Interaction between callNextMethod() and selectMethod()
Hi,
Strange things happen. Here is a simple example:
> setClass("A", contains="integer")
> setMethod("as.matrix", "A", function(x, ...) t(callNextMethod()))
Creating a generic function for ?as.matrix? from package ?base? in
the global environment
[1] "as.matrix"
> a <- new("A", 1:3)
> as.matrix(a)
2012 Aug 22
1
loading both RPostgreSQL and RSQLite leads to problems
hello,
if i load the RSQLite package in addition to the RPostgreSQL package,
i get various errors when trying to use RPostgreSQL functions. here is
an example transcript showing one such error:
==========================================================
R version 2.15.0 (2012-03-30)
[...]
> packageVersion('RPostgreSQL')
[1] 0.3.2
> packageVersion('RSQLite')
[1] 0.11.1
2005 Feb 10
1
Undocumented S4 methods: generic coerce and siglist matrix, Massvector
Hi,
While checking the package I am getting all the time the following
complain about the function:
Undocumented S4 methods:
generic coerce and siglist matrix,Massvector
I have not defined the function nowhere in the R files.
My gues is that this has something to do with the following definition
of the setAs function.
setAs("matrix","Massvector"
,def=
2007 Jul 16
1
S4 coerce
(I am not sure if this is a bug or a request for a more understandable
warning, or possible something obvious I should be posting on r-help.)
I am trying to coerce an new class object to be a DBIConnection and it
does not work the way I think it should:
R version 2.5.1 (2007-06-27) ...
> require("RMySQL") # or require("RSQLite")
Loading required package: RMySQL
Loading
2015 Jan 28
2
[Q] Get formal arguments of my implemented S4 method
Interrogating some (of my own) code in another package.
>norm.meth <- getMethod("normalize", "MatrixLike")
>message("str(norm.meth)")
>str(norm.meth)
>message("show(norm.meth at .Data)")
>show(norm.meth at .Data)
Last show() displays this:
function (object, ...)
{
.local <- function (object, method = c("median",
2008 Apr 09
1
coerce methods and inheritance
Hi,
It doesn't seem that the dispatching algo is finding my coerce method under
some circumstances.
Let's say I have 2 classes, A and AA and that AA is just a direct extension
of A with no additional slots:
setClass("A", representation(ii="integer"))
setClass("AA", contains="A")
I can define a method for coercing my objects to an integer
2015 Jan 28
0
[Q] Get formal arguments of my implemented S4 method
Would you please clarify your exact use case?
Thanks,
Michael
On Wed, Jan 28, 2015 at 9:02 AM, Roebuck,Paul L <PLRoebuck at mdanderson.org>
wrote:
> Interrogating some (of my own) code in another package.
>
> >norm.meth <- getMethod("normalize", "MatrixLike")
> >message("str(norm.meth)")
> >str(norm.meth)
>
>
2015 Jan 29
0
[Q] Get formal arguments of my implemented S4 method
At this point I would just due:
formals(body(method)[[2L]])
At some point we need to figure out what to do with this .local() confusion.
On Wed, Jan 28, 2015 at 10:07 AM, Roebuck,Paul L <PLRoebuck at mdanderson.org>
wrote:
> I'm attempting to reflect the information for use with corresponding
> fields in GUI (in a different package), to provide default values,
> argname
2010 Mar 08
1
confused by classes and methods.
Hello, I have a simple class that looks like:
setClass("statisticInfo",
representation( max = "numeric",
min = "numeric",
beg = "numeric",
current = "numeric",
avg = "numeric",
obs = "vector"
2015 Jan 28
2
[Q] Get formal arguments of my implemented S4 method
I'm attempting to reflect the information for use with corresponding
fields in GUI (in a different package), to provide default values,
argname as key for UI label lookups, etc.
So I want something much more like the formals of the implementation:
{
"object",
"method": c("median", "vs", "tukey"),
2008 May 23
1
seeing an S4 method, not using it
Dear list,
here is a problem I met when trying to use a method for an S4 object,
without loading the package in which the method was defined. I do not
know if this is a bug, or a mistake of mine. Normally, I think the
package in which the appropriate method is defined is loaded
automatically when calling the method. The problem is that if the
package is indeed loaded automatically, the
2003 Jul 26
2
How to make "<-" generic?
Hi,
perhaps a little bit unusual: is it possible to use "<- " as generic function
with a new signature?
The following example doesn't work:
> isGeneric("<-")
[1] FALSE
> setClass("A",representation(x = "numeric"))
[1] "A"
> setClass("B",representation(x = "numeric"))
[1] "B"
> myAssign.A <-