Displaying 20 results from an estimated 200 matches similar to: "Recent setClass fails where previous succeeded"
2010 Feb 02
1
S4 setClass / initialize misunderstanding
Hi, I recently ran into this problem. I couldn't find any mention of it in
the setClass documentation.
setClass("Foo", representation(file = "character"))
setMethod("initialize", "Foo", function(.Object, file) {
print(file)
})
setClass("Bar", contains = "Foo")
And the error:
Error in print(file) : argument "file" is
2014 Sep 17
1
issue with compiling r6
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I am painfully aware that this is most likely a problem with my
system, but I am nevertheless going to ask if anyone has any
ideas/suggestions for diagnosis and trouble-shooting.
- From a clean checkout of release 66624 on Ubuntu 12.04 (32-bit, sorry!):
gcc (Ubuntu/Linaro 4.6.4-1ubuntu1~12.04) 4.6.4
svn checkout https://svn.r-project.org/R/trunk/
2006 Jan 19
2
creating objects with a slot of class formula, using new
Hi,
This works fine.
>setClass("a",representation(b="list",c="list"))
>new("a",b=list(7))
>An object of class "a"
Slot "b":
[[1]]
[1] 7
Slot "c":
list()
But, now suppose you want a slot to accept an object of class formula...
>setClass("a",representation(b="list",c="formula"))
2004 May 27
3
"privileged slots"
Hi all,
in the help for RClassUtils I found the expression "privileged slots" in
function "checkSlotAssignment" with the explanation:
/privileged slots (those that can only be set by accesor functions
defined along with the class itself)/
I thought all slots of a (not private) class can be a accessed by a user
via the @ Operator.
Is there a way to make a single slot of a
2007 Jun 02
1
setClass with a slot of RODBC
Hi - I tried to get some answer before but there seems to have no one response. My question is that I have a class like below definition:
setClass("DBManager",
representation(channel="RODBC"))
My purpose of the conn slot is to hold a channel to database connection which is returned by a command like:
channel <- odbcConnect("DB", uid="user",
2009 May 13
1
question about setClass
Hi R People:
I have a question about setClass please. I'm working thru "R
Programming for Bioinformatics".
Actually, I was wondering if there is such a thing as an updateClass,
in order to change a "contains" option, please?
that is, if I had
setClass("dog",
representation(name="character",paws="numeric",tail="character"))
Fair
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
2006 Apr 21
0
Questions on version arg to setClass and serialized instances
I have a few questions and thoughts regarding class versioning and
serialized S4 class instances.
How is the version argument to setClass is intended to work? It
appears to want an externalptr, but that seems odd to me.
setClass("FOO", representation(x="numeric"), version="1.2.3")
Error in validObject(.Object) : invalid class
2006 Sep 27
1
potential setClass bug (with user-defined environment)
the following returns an error in an 'exists' call on my machine
MyEnv <- new.env()
setClass("Numeric", "numeric", where=MyEnv)
franklin parlamis
> version
_
platform powerpc-apple-darwin8.7.0
arch powerpc
os darwin8.7.0
system powerpc, darwin8.7.0
status beta
major 2
minor 4.0
year
2007 Jun 03
1
[R] setClass with a slot of RODBC
An embedded message was scrubbed...
From: David James <daj025 at gmail.com>
Subject: Re: [R] setClass with a slot of RODBC
Date: Sat, 02 Jun 2007 10:32:47 -0400
Size: 4053
Url: https://stat.ethz.ch/pipermail/r-devel/attachments/20070603/f3583feb/attachment.mht
2009 Jun 05
1
S4: Initialization method called during setClass??
Dear UseRs,
A simple class inheritance example:
> setClass("test",representation(a="numeric"))
> setMethod("initialize","test",
function(.Object,x,...){
print("Initialization!!!")
callNextMethod(.Object,a=x,...)
})
> new("test",x=23)
[1] "Initialization!!!"
An
2010 Mar 08
1
setClass or setValidity?
Hi,
I'm reading up on S4 classes *). There seem to be at least two ways of input validation:
setClass() (using the 'validity' argument) and setValidity(). Is it a matter of taste which function is used? Or should more complex validation code better be put in a setValiditity call?
*) A (Not So) Short Introduction to S4 Object Oriented Programming in R
V0.5.1 Christophe Genolini
2012 Feb 15
1
Cannot use setClass() in Rscript
Greetings,
I am creating a standalone executable script using Rscript and have run
into problems when I define a new S4 class. Here is a small script that
demonstrates my problem:
#!/usr/bin/env Rscript
#
# toy.Rscript -- testing S4 class creation in an Rscript
setClass("toy",
representation(name = "character",
price = "numeric"),
2012 Apr 03
1
Create Model Object (setClass?setMethod?)
Hi all,
I have a self written likelihood as a model and functions to optimize and
get fitted values, confidence intervals ect.
I wonder if there is a way to define a 'class', or a 'model' (or a certain
object)? so that I can use 'summary' to produce a summary like it does for a
lm object.
Also, it should be able to use 'predict' and 'plot' and other
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",
+
2019 Jan 10
2
setClass accepts slot-mismatch between slots and prototype arguments
I was installing the 'diffobj' package into TERR and got an error from the
call
StyleSummary <- setClass("StyleSummary",
slots=c(container="ANY", body="ANY", map="ANY"),
prototype=list(
container=function(x) sprintf("\n%s\n", paste0(x, collapse="")),
body=identity,
detail=function(x) sprintf("\n%s\n",
2024 Sep 27
1
Disabling S4 primitive dispatch during method resolution affects namespace load actions
Hello,
This problem originally surfaced as an interaction between 'brms',
'rstan' and 'Rcpp' [1]: a call to dimnames() from the 'brms' package on
an object of an S4 class owned by the 'rstan' package tried to load its
namespace. rstan:::.onLoad needs to load Rcpp modules, which uses load
actions and reference classes. Since methods:::.findInheritedMethods
2009 Jul 09
1
class export in package creation / setClass / namespace?
Dear all,
I have been trying to create an R package. This has been successfull until I
tried to define classes.
Currently, my procedure is the following:
Start R, load the function and class definition
>tmp <- function (x) {x}
>setClass("rpa", contains = "list", where=topenv(parent.frame()))
Use package skeleton to create directory structure:
2024 Sep 27
1
Disabling S4 primitive dispatch during method resolution affects namespace load actions
>>>>> Ivan Krylov via R-devel
>>>>> on Fri, 27 Sep 2024 13:32:27 +0300 writes:
> Hello,
> This problem originally surfaced as an interaction between 'brms',
> 'rstan' and 'Rcpp' [1]: a call to dimnames() from the 'brms' package on
> an object of an S4 class owned by the 'rstan' package tried to
2005 Aug 05
1
S4 setClass with prototypes " issues" (PR#8053)
To R-Developers:
I wish to report what I believe are inconsistencies between Green Book
descriptions and R methods behaviors. I **realize** that R does not
guarantee total consistency with the Green Book; therefore I leave it to you
to decide whether any of this is a bug, design choice, or a need for
additional documentation -- or whether I have simply misread or overlooked
existing explanations.