similar to: S4 setClass / initialize misunderstanding

Displaying 20 results from an estimated 100 matches similar to: "S4 setClass / initialize misunderstanding"

2009 Mar 29
1
Recent setClass fails where previous succeeded
These lines of code setClass("A", representation(x="numeric")) setMethod(initialize, "A", function(.Object, ...) stop("oops")) setClass("B", representation("A")) result in > setClass("B", representation("A")) Error in initialize(value, ...) : oops in R version 2.9.0 alpha (2009-03-28 r48239) R version 2.10.0
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"))
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",
2006 Jul 16
0
Routes Misunderstanding
Hi there, I seem to be misunderstanding routes a little bit as I can''t get the behavior I''m expecting from the following. My goal is to get "/forums/1" from the code <%= url_for :id => forum.id %> which is being called from a view associated with a controller named "Forums" and the "index" action. I have the following routes:
2006 Mar 23
1
validations.rb of ActiveRecord - bug or misunderstanding?
Either I''m not understanding how things are used, or this might be a bug in ActiveRecord. I''m using version 1.13.2. In my version of activerecord/lib/active_record/validations.rb (the svn trunk version is browsable at http://dev.rubyonrails.org/browser/trunk/activerecord/lib/active_record/validations.rb ), I have: def update_attribute_with_validation_skipping(name,
2005 Apr 11
1
/etc/rc.bsdextended: am I misunderstanding this..?
Can someone clear something up for me? [[[ # For apache to read user files, the ruleadd must give # it permissions by default. #### ${CMD} add subject uid 80 object not uid 80 mode rxws; ${CMD} add subject gid 80 object not gid 80 mode rxws; ]]] Doesn't the above mean that an apache user (eg, user-supplied CGI process, PHP script, etc) has the ability to read (and write!) anything in the
2004 Jan 24
0
rules/routes traversal misunderstanding
Hi, I''ve been experimenting with ip route for the last few days to get load sharing accross 2 providers working. While it works most of the time, on a few occasions, packets are routed to the wrong interface. I''m not sure to understand rules and routes traversal correctly (I couldn''t find answers in the howto). So, here are my questions: 1. How does the rule
2011 Feb 22
0
Arel: misunderstanding with intersections
Hi, I''ve been playing with Arel for a few days, but I feel really confused about predicates / arrays intersection. Let''s say I have 3 models: users, (bank) accounts and transfers. An account belongs to a user, and a transfer is made of a source and target accounts (see the snippets below). Given a user, I want to query his transfers. I can go this way in the User class: def