similar to: Viewing function code

Displaying 20 results from an estimated 6000 matches similar to: "Viewing function code"

2006 Oct 12
1
getMethods() not finding all methods
Running R2.4.0 on Apple Mac OS X 10.4.8, in Emacs ESS mode, and also R.app. In an attempt to learn a bit more about a particular method (geneNames in package affy) I invoked getMethods("geneNames") which produced geneNames methods, but not the one in affy (output below). I had to know the signature (AffyBatch) in order to find the method > getMethod("geneNames",
2006 Apr 13
2
[R] S4 method dispatch matrixOrArray (fwd)
What a delicious example! (I'm taking the liberty of sharing it with r-devel, since it raises some good issues.) You have two questions, presumably: 1 - how could the order of the setMethod calls make a difference in the results? 2 - what's causing the infinite loop & how could it be avoided, reliably? Second question first. The danger sign is the "vector" method:
2010 Jul 02
2
S4 classes and debugging - Is there a summary?
Dear all, I'm getting more and more frustrated with the whole S4 thing and I'm looking for a more advanced summary on how to deal with them. Often I get error messages that don't make sense at all, or the code is not doing what I think it would do. Far too often inspecting the code requires me to go to the source, which doesn't really help in easily finding the bit of code
2012 Mar 24
2
RC / methods package
(I think this is being caused by the new methods package in RC.) In the RC (March 24) some of my packages are generating a Note Note: Method with signature "MySQLConnection#integer" chosen for function "coerce", target signature "TSMySQLConnection#integer". "dbObjectId#integer" would also be valid This is coming from a call to dbGetQuery() in package
2010 May 21
1
S4 method defined but not used
Dear R developers, I am having a slightly weird issue with a S4 method defined in my package adegenet 1.2-4, with R 2.11.0. As far as I know, the problem is new, and the code implementing the method has not changed for more than a year and worked well so far. The problem is the following. I define, in the package, a method "[" for the S4 class 'genind'. The method's
2004 Jul 06
1
questions about setMethod("Arith", ...)
Hi, we have some questions concerning the definition of new arithmetic methods. In our package "distr" (on CRAN) we define some new arithmetic methods for "+", "-", "*", "/". After loading "distr" the corresponding arithmetic methods work. Now, if we define a new class and also a new method for one of the arithmetic methods
2009 Jul 29
1
RFC: methods() and showMethods() {was "debug"}
(a new thread, on purpose) >>>>> "RobG" == Robert Gentleman <rgentlem at fhcrc.org> >>>>> on Mon, 27 Jul 2009 16:55:50 -0700 writes: RobG> Hi, I just committed a change to R-devel so that if RobG> debug is called on an S3 generic function, all methods RobG> will also automatically have debug turned on for them RobG>
2009 Jan 30
1
Methods not loaded in R-Devel vs 2.8.1
Dear list-member, I am currently developing a package with S4 classes. The NAMESPACE and DESCRIPTION is printed below. Within this package I have set a method "residuals" for two classes. In version 2.8.1 these two are reported whereas in R-Devel (2009-01-28 r47766). What have I missed? What has changed and how can I rectify the issue? Your help and pointers are welcome. For 2.8.1:
2008 Feb 14
1
finding source for a function
Dear R Gurus: How do you get source for functions which say "UseMethod" when you type in their names, please? I've tried getAnywhere and getMethods...I thought that might produce them. Thanks in advance. Sincerely, Edna
2006 Oct 31
4
getMethod(s) and var.test
Hi, How do I retrieve the var.test() function code? I had a similar problem once before with another function but getMethods() solved the problem then. Now I tried several combinations for var.test() without success. Regards benjamin -- Benjamin Otto Universitaetsklinikum Eppendorf Hamburg Institut fuer Klinische Chemie Martinistrasse 52 20246 Hamburg [[alternative HTML
2006 Feb 06
3
decomposed.ts class and method
Dear R People: In the function "decompose", the object has the class of "decomposed.ts". (from package stats) I would like to see the class definition and the method for the plotting. However, when I use isClass("decomposed.ts") I get "FALSE". When I check getMethods("plot") there is no method for plot on decomposed.ts Any suggestions,
2012 Apr 24
2
How do i read the source code of "biplot"?
> biplot standardGeneric for "biplot" defined from package "stats" function (x, ...) standardGeneric("biplot") <environment: 0x0d4444d8> Methods may be defined for arguments: x Use showMethods("biplot") for currently available ones. > > > showMethods("biplot") Function: biplot (package stats) x="ANY"
2006 Jan 05
1
Generic Functions
Hi, I've been using the package "graph" in the BioConductor assortment and writing some functions based on its classes. My question is not specific to this package or BioConductor (I think), but it serves as a useful example. I recently wanted to look at the code for the function "edgeMatrix" for the class "graphNEL". Usually I would type > func.foo and
2005 Jun 02
1
showMethods doubt
Hi, I'm developing in S4 and I wanted to see the methods for a specific class using showMethods but I didn't succed. Can someone help ? See the example below. setClass("myclass", representation( name ="character" ) ) setGeneric("mymeth", function(obj, ...){ standardGeneric("mymeth") } ) setMethod("mymeth",
2006 Oct 17
1
Caching bug with showMethods?
showMethods isn't reporting inherited methods when it is first called. The methods are there and after calling them, showMethods gives the right output. Here is an example (using R-devel r39647): setClass("A", representation(x="numeric"), prototype=list(x=1)) setClass("B", contains="A", prototype=list(x=2))
2009 Feb 25
1
Unexpected side effect of the ":::" operator on the value of isGeneric
Hi, when running the following on a fresh R, library("IRanges") annotation showMethods("annotation") Biobase:::annotation showMethods("annotation") I get (see the "^^^^^" marked output at the bottom): > library("IRanges") Carico il pacchetto richiesto: 'IRanges' The following object(s) are masked from package:base :
2016 Mar 04
2
as.vector in R-devel loaded 3/3/2016
I see as below, where getGeneric and getMethod imply a different signature; the signature is mode="any" for both cases in R version 3.2.3 Patched (2016-01-28 r70038)I don't know how to reproduce Jeff's error, though. > library(Matrix) > as.vector function (x, mode = "any") .Internal(as.vector(x, mode)) <bytecode: 0xe79f88> <environment:
2012 Nov 15
2
How to modify a S4 function (in the package NADA)
I want to get access to the code of an S4 method in order to possibly modify a function to accomplish my particular needs: in my case the function in is cenfit() from the package NADA Now, given my reproducible example: my.ex<-structure(list(TEC = c(0.21, 0.077, 0.06, 0.033, 0.014, 0.0072), LR = c(0L, 0L, 1L, 0L, 1L, 0L)), .Names = c("TEC", "LR"), class =
2016 Mar 04
2
as.vector in R-devel loaded 3/3/2016
Er, until _what_ is fixed? I see no anomalies with the version in R-pre: > library(Matrix) > as.vector standardGeneric for "as.vector" defined from package "base" function (x, mode = "any") standardGeneric("as.vector") <environment: 0x7fe8f4516640> Methods may be defined for arguments: x, mode Use showMethods("as.vector") for
2003 Sep 05
2
S4 Method Collisions with "[" (PR#4075)
Full_Name: Colin A. Smith Version: 1.8.0 OS: Mac OS X 10.2.6 Submission from: (NULL) (216.102.90.18) Both Biobase and my package annaffy use S4 classes to define methods for "[". Both packages use the save image method of installation. (See annaffy 1.0.3 in BioC CVS.) Depending on how both packages are loaded, the Biobase definitions seem to be getting masked out: >