Displaying 20 results from an estimated 9000 matches similar to: "Problem with Rcmd check and S4 methods"
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
2004 Oct 08
1
Function _coerce_ in _setIs_ never entered (S4).
Hi,
Please consider the following trivial example.
In the sample code I first define a class MVCa using composition. This
class contains a slot of type list.
Next I define an inheritance relation using the function setIs -> MVCa
"is a" list.
Then I define a function printlength which prints the list-length which
is defined for the type "list".
If I call this function
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()
2006 Apr 07
4
setIs and method dispatch in S4 classes
Dear all,
I have a question regarding setIs and method dispatch in S4 classes:
Consider the following example:
#####################################################
## A02 "contains" A01 by setIs:
setClass("A01", representation(a="numeric",b="numeric"))
setClass("A02", representation(a="numeric",d="numeric"))
2008 Nov 26
1
S4 slot containing either aov or NULL
Dear listmembers,
I would like to define a class with a slot that takes either an object
of class aov or NULL. I have been reading "S4 Classes in 15 pages more
or less" and "Lecture: S4 classes and methods"
#First I tried with list and NULL
setClass(listOrNULL")
setIs("list", "listOrNULL")
setIs("NULL", "listOrNULL")
#doesn't
2003 Dec 24
1
Questions and suggestions about namespaces
I'm trying to add a namespace to my orientlib package. It makes use
of S4 methods.
A few questions, and a couple of suggestions:
1. Is there a way to put version dependency into the NAMESPACE file?
I need to import something from stats in r-devel, but (of course) I
get an error when using the same import directive in r-patched and
earlier versions, because there is no stats package.
2.
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
2003 Mar 31
1
setIs?
I've recently updated from an early February version of 1.7.0 to
Version 1.7.0 Under development (unstable) (2003-03-25)
and am now having problems with errors giving the message:
' getExtends(ClassDef) : @ must be used on an object with a formal class'
which seems to be caused by 'setIs("character","character or NULL")'
which attempts to define
2008 Mar 17
1
setAs vs setIs
Hi the list
I am fighting with the twins setAs and setIs...
Here are some questions and comments (comments to myself but that migth
be wrong, it is why I am posting them)
1. Very surprising : using setIs define 'is', 'as<-' but not 'as' ???
2. Using setAs define 'as', 'as<-' but not 'is'...
What surprise me is that as<- can be define by
2005 Nov 22
1
failure in `setClass' examples
Hello,
Below is what I got running the examples from `setClass'. Could somebody
please help explain why the last `setIs' call is returning the warning and
whether this is expected?
R> setClass("track",
+ representation(x="numeric", y="numeric"))
[1] "track"
R> setClass("trackCurve",
+
2015 Mar 13
1
Understanding why "no metadata object found ... not exported?" warnings from the methods package exist, and what they mean
On looking more closely, the purpose of finding the class definition is to update the entry for the new relationship, as the warning message suggests. That requires that the namespace holding the definition be writable.
In the case of subclass information, the original namespace is very likely to be locked, if it's not the package currently being loaded. Copying the definition in order to
2003 Jul 24
0
Revisions of the S4 classes software + ?Documentation
Some changes to the implementation of S4 classes in the methods package
will be committed to the r-devel version, probably later today. They
should be largely back-compatible (exception noted below) but they are
fairly extensive, so this is an advance notice.
The changes form the first of a two-stage change aimed at making the
implementation more consistent with R semantics, in particular with
2003 Jul 09
2
Packages, generics, S3 and S4
My question has two parts.
The first is with regard to the frame or environment in which generic
functions are defined in packages. It seems as though they are defined
(i.e. exist as objects) in frame 1, even when defined in a package.
The following is a short example:
setClass("track",representation(x="numeric",y="numeric"))
plotTrack <- function(x,y,...)
2012 Mar 15
1
Extending a group of S4 classes by setClassUnion ?
Hi,
I would like to create some S4 classes as follows
setClass("Father",representation(name="character"))
setClass("Son1",contains="Father",representation(par="numeric"))
setClass("Son2",contains="Father",representation(par="logical"))
Son1<-new("Son1")
Son1 at name<-"Son1"
Son1 at par<-3
2016 Mar 19
2
unary class union of an S3 class
On 03/19/2016 01:22 AM, Michael Lawrence wrote:
>
>
> On Sat, Mar 19, 2016 at 12:10 AM, Herv? Pag?s <hpages at fredhutch.org
> <mailto:hpages at fredhutch.org>> wrote:
>
> On 03/18/2016 03:28 PM, Michael Lawrence wrote:
>
>
> On Fri, Mar 18, 2016 at 2:53 PM, Herv? Pag?s
> <hpages at fredhutch.org <mailto:hpages at
2015 Mar 12
2
Understanding why "no metadata object found ... not exported?" warnings from the methods package exist, and what they mean
Hi
I am seeking to understand why the methods package (to be specific
`methods:::.findOrCopyClass` when called by `setIs` when called by
`setClass`) emits a warning message such as
` class "SpatialLinesNULL" is defined (with package slot 'rgeos') but no
metadata object found to revise subclass information---not exported? Making
a copy in package 'minweSpatialNULL `
2016 Mar 19
2
unary class union of an S3 class
On 03/18/2016 03:28 PM, Michael Lawrence wrote:
>
> On Fri, Mar 18, 2016 at 2:53 PM, Herv? Pag?s <hpages at fredhutch.org
> <mailto:hpages at fredhutch.org>> wrote:
>
> Hi,
>
> Short story
> -----------
>
> setClassUnion("ArrayLike", "array")
>
> showClass("ArrayLike") # no slot
>
>
2009 Aug 17
2
S4: inheritance of validity methods?
Dear Developers,
In current implementation of validity method, objects are first coerced to
superclass (slots are striped). Thus, it is not possible to write validity
method which would perform some checks on children slots.
Say, I want to check if number of slots in a class is equal to "n":
setClass("A", representation(a="numeric", n="integer"),
2004 Oct 25
1
usage and behavior of 'setIs'
Hello,
am I using 'setIs' in the correct way in the subsequent (artifical) example?
Do I have to specify explicit 'setAs' for 'list' and 'vector' or
should this work automatically, since "getClass("List1")" states
an explicit coerce also for these classes.
I'm working with R 2.0.0 Patched (2004-10-06) on windows 2000.
Thanks for your
2004 Jan 08
3
S3, S4, namespace
I have encountered an issue which I have been unable to resolve, involving
an S3 generic (print) being declared S4 generic in a package, and the method
being exported. This all works fine - the problem occurs when I try to
import the method to another package.
Here is the bit that works fine. -------------
#the .r file for package bar