Displaying 20 results from an estimated 20000 matches similar to: "Same class name, different package"
2008 Aug 07
1
'"ts" treated as a registered S3 class, but keep its "structure" behaviour' ?
Dear all,
In R-devel I have noticed the new approach for the "ts" class in the
package "methods".
the "structure" behaviour of "ts" is not always kept when one uses
"ts" objects and objects of classes which extend the virtual class
"structure".
As a short example:
## this works fine
setClass("foo", representation(header =
2005 Aug 11
1
Registering S3 class from external package
The package I'm working on can extract data from external
packages but would otherwise have no dependency on them.
However, I desire to be able to dispatch based on an
external S3 class if its package is attached (.First.lib).
My code is S4-based and its package has NAMESPACE.
Registering the external class prior to the other
package being attached doesn't seem to work so I am
attempting
2015 May 28
3
S4 inheritance and old class
Hey everyone,
I would like to develop a package using S4 classes.
I have to define several S4 classes that inherits from each others as
follow:
# A <- B <- C <- D
I also would like to define .DollarNames methods for these class so, if I
have understood well, I also have to define an old class as follow:
# AOld <- A <- B <- C <- D
setOldClass(Classes = "AOld")
2004 Aug 25
0
S3 classes in S4 class definitions
One of the changes some packages are noticing from the recent
modifications to methods is warnings of "undefined classes" during
installation when the package extends S3 classes or uses them as slots
UNLESSS they have been declared in a setOldClass() call. The green book
"strongly recommends" declaring S3 classs this way (pp 449-451).
The warnings on undeclared classes
2018 Feb 14
2
How to turn off warnings about class name conflicts
Hi,
I am using two packages (quantmod and FRAPO)
Quantmod and FRAPO both have a class names "zoo"
R is displaying the following warning when I manipulate an object of class
zoo:
Found more than one class "zoo" in cache; using the first, from namespace
'quantmod'
Also defined by ?FRAPO?
The warning is displayed every time I manipulate a zoo object and becomes
pretty
2015 May 12
2
Unexpected failure when calling new() with unnamed arg and
Hi,
The man page for new() suggests that if 'a' is an object with slots
"slot1" and "slot2" and C is a class that extends the class of 'a',
then the 2 following calls should be equivalent:
new("C", a, ...)
new("C", slot1=a at slot1, slot2=a at slot2, ...)
This is generally the case but I just ran into a situation where it's
not.
2015 May 13
2
Unexpected failure when calling new() with unnamed arg and
Thanks Martin for looking into this. H.
On 05/13/2015 03:57 AM, Martin Maechler wrote:
>>>>>> Herv? Pag?s <hpages at fredhutch.org>
>>>>>> on Tue, 12 May 2015 15:18:42 -0700 writes:
>
>> Hi,
>
>> The man page for new() suggests that if 'a' is an object with slots
>> "slot1" and "slot2" and C is a
2011 Jan 28
2
help with S4 objects: trying to use a "link-glm" as a class in an object definition
Hi,
I'm trying to make a new S4 object with a slot for a "link-glm" object. R doesn't like me have a slot of class "link-glm"
> class(make.link("probit"))
[1] "link-glm"
> setClass("a",representation(item="link-glm"))
[1] "a"
Warning message:
undefined slot classes in definition of "a": item(class
2014 Oct 07
1
S4 Method Dispatch for Class Defined as Attribute
Hello,
I am writing an interface to some functions from the CRAN package pamr, which is poorly written.
I have a S4 method I declared with setMethod. I'd like to provide a signature of "pamrtrained" which is the class of object that training creates. The last two lines of code of pamr.train are :
class(junk) = "pamrtrained"
junk
How can I dispatch on these kinds
2018 Feb 14
0
How to turn off warnings about class name conflicts
On 2/13/2018 11:47 PM, Ayhan yuksel wrote:
> Hi,
>
> I am using two packages (quantmod and FRAPO)
>
> Quantmod and FRAPO both have a class names "zoo"
>
> R is displaying the following warning when I manipulate an object of class
> zoo:
>
> Found more than one class "zoo" in cache; using the first, from namespace
> 'quantmod'
>
2002 Sep 10
0
Old-style classes: bug fix & request
Bug fix:
A bug introduced in version 1.6 failed to "initialize" some old-style
(aka "S3") classes, producing possible warning messages if those classes
were used in the signature of a method in the methods package.
The real bug, though, was that old-style inheritance could not be
included, until the setOldClass function was provided. Initializing the
methods package now
2008 Jan 05
3
is(x, "parent") returns FALSE when class(x) is c("child", "parent") (PR#10549)
is() does not catch parent S3 classes:
> library(splines)
> temp <- bs(1:99, df=5)
> class(temp)
[1] "bs" "basis"
> is(temp, "basis")
[1] FALSE
In contrast, is() does catch parent S4 classes:
> library(copula)
> norm.cop <- ellipCopula("normal", param = c(0.5, 0.6, 0.7),
+ dim = 3, dispstr = "un")
2010 Jun 13
1
S4 classes and S3 generic functions
A general goal for the next version of R is to make S4 and S3 play
better together.
As mentioned in a previous thread, one limitation has been that S3
generic functions, specifically the UseMethod() call, did not make use
of S4 inheritance when dispatching on general S4 objects.
This has been fixed in a version committed today (updated to rev 52267).
The code change is not large, but it
2020 Sep 24
2
Is it possible to simply the use of NULL slots (or at least improve the help files)?
Hi Martin,
Thankyou for your response.
I suspect that we're not going to agree on the main point.
Making it trivially simple (as say Java) to set slots to NULL.
So, I'll move on to the other points here.
***Note that cited text uses excerpts only.***
> setClassUnion("character_OR_NULL", c("character", "NULL"))
> A = setClass("A", slots =
2009 Sep 26
1
questions on csv reading
Hi,
Is there any official way to determine the colClasses of a data.frame?
Why has POSIXct such a strange class structure?
Why is colClasses "ordered" not allowed (and doesn't work)?
Background
==========
I am writing a chunked csv reader that provides the functionality of read.table for large files (in the next version of package ff). In chunked reading, one wants to learn the
2011 Apr 20
2
Package Name Not Found Warning
Hello,
I've got a DESCRIPTION file with a the first line:
Package: Repitools
But, when I run R CMD INSTALL Repitools I get:
* installing *source* package Repitools ...
** R
** data
** inst
** preparing package for lazy loading
Warning in FUN(X[[1L]], ...) :
Created a package name, "2011-04-20 09:05:40", when none found
** help
*** installing help indices
** building package
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 Sep 29
1
Problem with _new_ if class "lm" in object representation.
Hi!
Consider this code.
setClass("Ctest"
,representation(
test="character"
,bla="character"
,mod="lm"
)
)
new("Ctest",test="bla") #This produces an error.
#Error in validObject(.Object) : Invalid "Ctest" object: Invalid object for slot "mod" in class "Ctest": got class
2015 Oct 08
1
Unexpected failure when calling new() with unnamed arg and
>>>>> Joshua Wiley <jwiley.psych at gmail.com>
>>>>> on Thu, 8 Oct 2015 12:19:16 +1100 writes:
> Hi, I realize this is an old thread, but just wondering
> whether a conclusion was ever reached on this issue? I'm
> using formula(NULL) but it would be nice if default
> initialization worked for formula classes as well.
Well,
2019 Sep 06
2
Cryptic error message from namespaceExport
Dear all,
Today I got this error message (R 3.6.1) when installing my package:
Error: package or namespace load failed for ?inlatools? in
namespaceExport(ns, exports):
undefined exports: .__C__inla
My package was using setOldClass("inla") and exported the "inla" class via
the NAMESPACE. It imports functions from the INLA package. Older versions
of the INLA package did not