similar to: list of all methods winthin an S4 class

Displaying 20 results from an estimated 500 matches similar to: "list of all methods winthin an S4 class"

2010 Apr 21
1
VERY basic question about S4 classes
Hi,   I'm new to R and S4 classes. I defined a class with two methods (myMethod1 and myMethod2). I want to call myMethod1 within myMethod2. Why does the code below not work? The name 'myMethod1' doesn't appear to have meaning inside myMethod2, even though the two methods belong to the same class.     setClass(Class="SomeClass",      representation=representation(      
2010 Jul 21
1
fix()ing an S4 method
Hi R experts,   The fix() function canbe used to edit normal functions. I would like to know whether it's also possible to use something similar to edit a method of an S4 class. In other words, is there a fix-like function that allows me to edit method definitions without having to go back to the source code?   setGeneric (name="doStuff",def =
2010 Apr 25
1
method dispatching vs inheritance/polymorphism (re-post)
Hi, I'm having trouble seeing the added value over functions defined by setGeneric vis-a-vis methods defined by inheritance and polymorphism. setGeneric offers a 'clean' call to a generic function, ie. no need to call new(), so less typing to do for the user. But such explicit calls can also be avoided by functions like f <- function(x, y) new(Class = SomeClass, x=x, y=y). Then
2010 May 20
1
getSubClasses()?
Hi,   Is there a built in function that returns a character vector of all subclasses of a given superclass? showClass(Class = "SomeClass") contains the info that I want, but I don't know how to access it. getSubClasses <- function(superClass) return(setdiff(getClasses(.GlobalEnv), superClass)) wíll only work if the global enviroment isn;t filled with other class definitions.
2006 Mar 04
2
convert string to AR class
Hi everyone, I''m trying to convert a string passed on the command-line into an ActiveRecord class, so I can do something like this. a="SomeClass" a.find(:all) where class SomeClass < ActiveRecord::Base end This appears to work (better ways would be appreciated): a="SomeClass" b=eval a b.find(:all) However I would like to make sure
2006 Sep 27
1
acts_as_taggable with single-table inheritance?
Does anyone have any experience making this work? I installed the plugin and tried the following: class SomeClass < ActiveRecord::Base acts_as_Taggable end class SubClass1 < SomeClass end class SubClass2 < SomeClass end SubClass1.tag_with("tag") and notice that taggable_type = SomeClass when I do SubClass2.find_tagged_with("tag") a SubClass1 object is
2007 Jul 25
2
initalizing and checking validity of S4 classes
Dear useRs and wizaRds, I am currently developing a set of functions using S4 classes. On the way I encountered the problem exemplified with the code below. For some reason the 'validity' method does not seem to work, i.e. does not check for errors in the specification of the slots of the defined class. Any hints? My understanding of the whole S4 system was that validity checks are made
2005 Aug 10
1
using modules with models?
I''m trying to figure out how to use modules with my model classes. I''m going to have good number of model classes that don''t map to the database, and I''d like to put some of these in seperate modules. I''ve been wrestling with this for 2 days and can''t figure out how to get it to work. Rails seems to handle it fine for controllers, though. I
2014 Feb 11
2
$new cannot be accessed when running from Rscript and methods package is not loaded
Hi Accesses the $new method for a class defined in a package fails if the methods package is not loaded. I have created a test package with the following single code file: newTest <- function() { cl <- get("someClass") cl$new } someClass <- setRefClass("someClass") (This is similar to code actually used in the testthat package.) If methods is not loaded,
2013 Apr 16
7
puppet-cleaner: makes puppet DSL code comply with a subset of the style guide
FWIW, I''ve wrote puppet-cleaner to help me make comply thousands of lines of puppet 2.6 DSL code to puppet 2.7 style guide and expectations. I''m uploading it to github today for anyone to use. https://github.com/santana/puppet-cleaner Externally, you run puppet-clean file.pp and it can transform this: /* multiline comment trailing white space here -> */ class
2012 May 08
2
creation of storage volume fails
hi, i am getting this error below when i try to create a storage volume: ? ? libvirt.virStoragePool.CreateXML(storagepoolobject,xmldesc,0) AttributeError: class virStoragePool has no attribute 'CreateXML' my code is: xmldesc="xml description of storage volume which i got from sudo virsh vol-dumpxml" #get a storage pool object to use in creating a volume
2009 Nov 02
1
two small wishes (with code sugegstions) for R-core
Dear R developers, It would be great if you could implement the two minor code changes suggested below, which would help processing large objects in R. Jens Oehlschl?gel # Wish no. 1: let [.AsIs return the class AFTER subsetting, not the class of the original object # Wish no. 2: adjust write.csv and write.csv2 for multiple calls in chunked writing # Rationale no. 1: a couple of packages
2007 Sep 18
2
Making attachment_fu polymorphic
I am working on a small model mixin called attachment_kung to make attachment_fu polymorphic, so you no longer need a different table and Model class for every associated attachment (Productimage, Ad_doc, etc). All you really need is one model and table to handel all your attachments - in some cases, anyway. I have the code working, but have run into one small hitch that I can''t seem to
2006 May 09
2
name and class href attribute in a link_to_remote
I have a link to remote and I''m trying to get the name="" and the class="" attribute in the href so the link will come out like this: <a href="action" onclick"ajax(action)" name="Title Of Link" class="someclass"> So far the link looks like this: <% for course in @courses %> <%= link_to_remote
2006 Nov 22
2
.class call to the mock object (or any existing methods)
Hi I run into problem trying to set expectations for the mockobject.class method, I had to undefine a method before I could set some expectation. Is there any better way of doing it? object = mock() .... klass = class <<object; self; end klass.send(:undef_method, "class") # I had to do this because Mocha utilizes "method_missing(symbol, *arguments, &block) "
2006 Nov 19
2
underscores, sugar, and more and more bugs
I sent this earlier under with the subject "artificial sugar causes cancer" and I think some spam filters ate it. Here it is again: ====================================== All, If you look at http://rubyforge.org/tracker/index.php?func=detail&aid=6760&group_id=797&atid=3149 you''ll see that Chad (the submitter) found the source of the bug. Unfortunately, the source
2006 Feb 14
1
Error handling
Hi, I''m stuck right now with a problem concerning error handling. I''ll try to explain the problem in short: In a controller class I have a method edit: def edit @some_class = SomeClass.find(params[:id]) end The record originates from a database table. What happens if the user enters a field that fails validation and I return to my edit page? I get the idea that th
2009 Aug 30
4
[LLVMdev] Perfect forwarding?
BLAST! LLVM mailing list headers are still royally screwed up... My message is below... On Sun, Aug 30, 2009 at 2:20 PM, Talin<viridia at gmail.com> wrote: > Hey all, it's been a while since I have posted on this list, but I've > been continuing my work with LLVM and getting lots done :) > > One question I wanted to ask is whether anyone had any advice on how to >
2019 Nov 11
2
class(<matrix>) |--> c("matrix", "arrary") [was "head.matrix ..."]
>>>>> Duncan Murdoch >>>>> on Sun, 10 Nov 2019 11:48:26 -0500 writes: > On 10/11/2019 9:17 a.m., Bryan Hanson wrote: >> >> >>> On Nov 10, 2019, at 3:36 AM, Martin Maechler <maechler at stat.math.ethz.ch> wrote: >>> >>>>>>>> Gabriel Becker
2006 Nov 19
6
artificial sugar causes cancer
All, If you look at http://rubyforge.org/tracker/index.php?func=detail&aid=6760&group_id=797&atid=3149 you''ll see that Chad (the submitter) found the source of the bug. Unfortunately, the source of *this* bug is the *solution* to a *previous bug* in which Rails was replacing RSpec''s method missing with its own. When we settled on underscores, my one reservation was