similar to: 'methods' and "[<-"

Displaying 20 results from an estimated 8000 matches similar to: "'methods' and "[<-""

2004 Jan 29
1
setMethodReplace.. Help!
Hi! Trying to reproduce some examples from "Programming with Data" page 341. Can not reproduce it neither on R1.8.1. nor R1.9.0devel? library(methods) setClass("track",representation(x="numeric",y="numeric")) setMethod("[" ,"track" ,function(x,...,drop=T){ track(x at x[...],y at y[...]) }
2003 Aug 21
2
efficiency and memory use of S4 data objects
I do lots of analyses on large microarray data sets so memory use and speed and both important issues for me. I have been trying to estimate the overheads associated with using formal S4 data objects instead of ordinary lists for large data objects. In some simple experiments (using R 1.7.1 in Windows 2000) with large but simple objects it seems that giving a data object a formal class
2003 Jun 02
1
'methods' and environments.
Hi, I have quite some trouble with the package methods. "Environments" in R are a convenient way to emulate pointers (and avoid copies of large objects, or of large collections of objects). So far, so good, but the package methods is becoming more (and more) problematic to work with. Up to version R-1.7.0, slots that were environments were still references to an environment, but I
2002 Nov 05
1
function showMethods and inheritance
Hi, The following question might come from my (deep) misunderstanding of the concepts in the package 'methods'. I have a class 'A', and a class 'B' inheriting 'A' (so defined with 'setClass' and the parameter 'contains="A"'. The class A has a method 'mymethod'. A call to 'showMethods("mymethod")' return the
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: >
2003 May 24
2
Re: R-devel Digest, Vol 3, Issue 23
I am another person who has had trouble documenting S4 classes and (particularly) methods. The methods package itself is pretty cool by the way, but it is a pity that there are as yet no guidelines on S4 in the "Writing R Extensions" document. I have actually put together a guide on S4 documentation myself for the use of my own lab which is at
2003 Oct 13
2
Infinite recursion in getGeneric (PR#4561)
> setClass('foo') [1] "foo" > setMethod('is.logical', 'foo', function(x) TRUE) [1] "is.logical" > getGeneric('is.integer') Error in options(x) : evaluation is nested too deeply: infinite recursion? > --please do not edit the information below-- Version: platform = i686-pc-linux-gnu arch = i686 os = linux-gnu system =
2002 Aug 06
2
[ and setMethod conflict?
I noticed this oddity about [ and setMethod. First, I define testFunc, which sorts a data frame by the first column and returns the entries that aren't NAs, and testIt, which runs testFunc repeatedly on a random large data frame, each time saving the return into a dummy placeholder (for demonstration's sake). > require(methods) Loading required package: methods [1] TRUE > testFunc
2002 Aug 06
2
[ and setMethod conflict?
I noticed this oddity about [ and setMethod. First, I define testFunc, which sorts a data frame by the first column and returns the entries that aren't NAs, and testIt, which runs testFunc repeatedly on a random large data frame, each time saving the return into a dummy placeholder (for demonstration's sake). > require(methods) Loading required package: methods [1] TRUE > testFunc
2003 May 30
2
Creating a vector class
I'm trying to create a package for working on orientation data, i.e. data where the observations are 3D rotations. There are several different representations of orientations in common use: SO(3) matrices, Euler angles, unit quaternions, etc. One thing I'd like is to make it convenient to work in any representation, and have conversions to others done as needed. I'm trying to do
2003 Nov 19
2
Was: setValidity and "initialize" method conflict ? [in R-help]
Hello, Thomas Stabla (statho3@web.de) has already sent this question to R-help, Wed, 12 Nov 2003 21:21:31 +0100, but we are not sure whether we should better post this mail to this audience than to R-help: --------------------------------------------------------------------- We are using S4-classes and want to force a validity check when an object is created. How can this be done, when an
2002 Feb 19
1
library(methods): setMethod with "ANY" fails. (PR#1317)
Full_Name: Henrik Bengtsson Version: R v1.4.1 OS: WinMe Submission from: (NULL) (217.208.14.137) Doing the following library(methods) setGeneric("foo", function(x) standardGeneric("foo")) setMethod("foo", "ANY", function(x) cat(x)) fails with Error in while (value[n] == "ANY") n <- n - 1 : missing value where logical needed It
2003 Sep 02
1
completeSubclasses() methods bug (PR#4051)
Full_Name: Colin A. Smith Version: 1.8.0 OS: Mac OS X 10.2.6 Submission from: (NULL) (128.102.184.81) annaffy 1.0.1 (in BioC CVS) fails to load. annaffy 1.0 (on the BioC web site) has the same problem. It looks like the load is failing because of a bug in completeSubclasses() in r-devel. It calls setIs() and doesn't specify an environment via the "where" argument. setIs()
2003 Jun 13
1
Problem with Rcmd check and S4 methods
In the little orientation data package I'm working on, the very first example fails, even though the same code works when used in a regular session. In my experience, this usually indicates T or F has been used instead of TRUE or FALSE, but that's not the case this time. The error message is > x <- eulerzyx(1,0,0) Error: Trying to get slot "validity" from an object of
2003 Oct 27
1
initialization of S4 classes/methods
I'm seeing weird issues in methods initialization, i.e. loading marrayClasses loads Biobase, and when explicitly done, as in library(Biobase) library(marrayClasses) is fine, but when Biobase is loaded via a require statement in marrayClasses' .First.Lib, I end up with: Warning message: In the method signature for function "coerce", class "exprSet" has no
2002 Sep 10
1
setGeneric(); R CMD check
1. Is it always the case that when defining generic functions in a package, the package needs to be installed as a binary package to avoid having the generic functions in the .GlobalEnv? 2. Defining a generic function in a "non-binary" package triggers a check warning $ R CMD check ... ... * checking for code/documentation mismatches ... WARNING Objects
2004 Jul 14
2
tracing something in a namespace (PR#7091)
# Your mailer is set to "none" (default on Windows), # hence we cannot send the bug report directly from R. # Please copy the bug report (after finishing it) to # your favorite email program and send it to # # r-bugs@r-project.org # ###################################################### > x <- rnorm(10) > y <- 1:10 > xyplot(y ~ x) >
2003 Jun 10
1
c(...) and methods
I have been writing some S4 classes and have a problem about how I might pass a signature to "c()". Take the following example: setClass("collection", representation("list", date="POSIXt")) x <- new("collection", list(1,2,3), date=Sys.time()) y <- new("collection", list(4,5,6), date=Sys.time()) obviously, I can do c(x,y), but
2003 Sep 16
2
couldn't find function "setClass"
Hello ... With a new checkout of R-devel (last update was 2003-09-11) we are having a problem (it seems to be happening to all of us here on a few different machines) where during install/check/etc when the 'save image' happens (in packages using 'save image'): ** save image Error: couldn't find function "setClass" Execution halted This is for all packages that
2003 May 21
1
callNextMethod
Hi, I don't understand why this code doesn't work (f(b2)): ///////////////// setClass("B0", representation(b0 = "numeric")) setClass("B1", representation("B0", b1 = "character")) setClass("B2", representation("B1", b2 = "logical")) f <- function(x) class(x) setMethod("f", "B0",