similar to: Fw: Having problem to define a subclass, please help me

Displaying 20 results from an estimated 10000 matches similar to: "Fw: Having problem to define a subclass, please help me"

2008 Mar 15
1
Fwd: Re: How to create following chart for visualizing multivariate time series
Thanks David, It is working. Holtman's also gave me a solution but, I wanted to have a color pallet for description of colors, that was not in his solution. However I need one small modification. If I want to plot only lower diagonal elements of 'dat' then how should I proceed? What I want is, to visualize only lower diagonal elements and having the color pallet on them only. Also
2008 May 07
0
Fwd: Re: Solution of function
Forgot to send one copy to R help. Sorry Megh Dal <megh700004@yahoo.com> wrote: Date: Wed, 7 May 2008 02:45:09 -0700 (PDT) From: Megh Dal <megh700004@yahoo.com> Subject: Re: [R] Solution of function To: Berwin A Turlach <berwin@maths.uwa.edu.au> Hi Berwin, Thanks for having look on my problem. However on ipop() function I see following: ipop solves the quadratic
2008 Mar 15
1
How to create following chart for visualizing multivariate time series
Let me take an artifical matrix : dat = matrix(rnorm(200*200), 200, 200) My goal is to visualize this matrix according to the procedure, described in previous mails. I took Mendelssohn's advice and got following advice : ?plot.im Z <- setcov(owin()) plot(Z) .................... etc However I can not reproduce this example in my problem. How I can change my data
2005 Aug 05
1
S4 generating function
Can someone explain what the problem is when I use the generating function? And how to get debug() to stop in the Superclass initialize method? ---- source ----- setClass("Superclass", representation(id = "character"), contains = "VIRTUAL") setMethod("initialize", signature(.Object = "Superclass"),
2008 Feb 29
1
Problems initializing an extended S4 class
Hi all, I am having trouble extending S4 classes in cases where I'm using both validity and initialize methods. I've read as much S4 information as I can find, but I've yet to have that "a-ha" moment. In my application, I am using validity methods to guard against inappropriate input data that my code has no way of handling, and initialize methods to detect and deal
2011 Feb 07
1
Seeking help to define s4 method for 'print'
I have got another question on defining a method for print() function for my s4 class. Here is my class definition as well as what I have done till now: > setClass("Me", representation(x1 = "numeric", x2 = "numeric", y1 = "character")) [1] "Me" > setMethod("print", "Me", definition=function(x) { + cat("Values
2008 Feb 29
1
Fwd: Re: How to create following chart for visualizing multivariate time series
I used ?image function to do that, like below : require(grDevices) # for colours x <- y <- seq(-4*pi, 4*pi, len=27) r <- sqrt(outer(x^2, y^2, "+")) image(x, y, r, col=gray((0:32)/32)) However my next problem to add a color pallet for color description [as shown in following link]. If anyone here tell me how to do that, it will be good for me. Regards, Megh Dal
2011 Feb 01
1
Help need to define method of an s4 class
I need some help in defining a "print" method for my new S4 class definition. So fer I have worked like this: setClass("MyClass", sealed=F, representation(slot1 = "list", #create a new class slot2 = "vector", slot3 = "vector", slot4 = "vector")) setMethod("print",
2006 Apr 12
1
yet another problem with S4 dispatch (with setClassUnion)
Dear John and Seth, dear R-devels, once again the question of method dispatch in S4 -- this time with setClassUnion(); taking up your advice in https://stat.ethz.ch/pipermail/r-devel/2006-April/037200.html https://stat.ethz.ch/pipermail/r-devel/2006-April/037201.html I have been too quick in stating that >setClassUnion()---at least in my case---solves the problem; > The problem arises
2003 Sep 09
0
problem trying to use a superclass on R-1.7.1
Hi dear helpers, I have been using for quite a long time a script where a class extends another one (without trouble). But I now have problems of that kind while trying to run the script : Error in insertMethod(methods, sig, args, def, TRUE) : inserting method corresponding to empty signature I think this may be because the way I wrote the scripts could be deprecated. Indeed I
2003 Sep 29
0
problems trying to extend a class
Hi all, I have been using for quite a long time a script where a class extends another one (without trouble). But I now have problems of that kind while trying to run the script : Error in insertMethod(methods, sig, args, def, TRUE) : inserting method corresponding to empty signature I think this may be because the way I wrote the scripts could be deprecated. Indeed I recently
2007 Aug 05
1
Understanding of Johansen test.
Dear all, I am struggling to understand the johansen test procedure in the context of co-integration in time series. Yes I understand that this forum is not directly statistics related but still I am posting here hoping that I would get som help. The error correction representation of a VAR[p] model can be written as: Delta y[t] = A[0]*y[t-1] + A[1]*Delta y[t-1] +..............
2010 Mar 16
1
Problem with S3 to S4 transition
Hello to everybody I am developing a package using R and have the following problem: I used to work in a mixture of S3 and S4 mechanism environment: as a matter of fact, I used to define my classes (say "DB" for illustration) using the setClass function (with representation field), and I was using the S3 implicit mechanism writing the functions: print.DB and plot.DB. Recently, I
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
2007 Apr 19
2
setClass inside a function
Hello, I would like to create a function that gets passed a class name and then calls setClass, and a few other functions, inside. I have done this in the past with setmethod, creating accessors for all slots in a set of S4 classes. But setClass is choking when my function is called isnide a package, telling about an error in exists(cname, where). I assume this to be a problem with the
2020 Feb 18
0
Possible Regression in setClassUnion between 3.5.0 and 3.6.0
Hi Robert, This looks like a bug to me (tested in R 3.6.2 on Windows), f(new("a")) should return "hi!". I'll add that this DOES work properly in 3.6.1 which leads me to suspect this could be due to the subtle change in the way method dispatch was performed to fix a different bug, in 3.6.2. Can anybody else confirm that? On 2/18/2020 9:32 AM, Robert Harlow wrote: >
2003 May 21
1
callNextMethod
Hi, I don't understand why this code doesn't work (f(b2)): ///////////////// setClass("B0", representation(b0 = "numeric")) setClass("B1", representation("B0", b1 = "character")) setClass("B2", representation("B1", b2 = "logical")) f <- function(x) class(x) setMethod("f", "B0",
2006 May 11
1
@ accesses attributes, not just formal slots ?
Using the '@' operator, I am able to extract a 'names' attribute assigned to a formal object. However, I can not use the replacement form ('@<-') to assign that attribute. > setClass("foo", representation("numeric")) [1] "foo" > (new("foo", 1:4)->a) An object of class ?foo? [1] 1 2 3 4 > names(a) <-
2004 Jun 18
0
Problem with setValidity() or resetClass() or ... ?
Hi, I'm working with Version 1.9.0 (2004-04-12) on Windows 98/NT/2000 where I found the following wrong (?) behavior of setValidity(). I already mentioned this on the R-help list (2004-06-11, was "setValidity changes Extends?") , but as I got no answer I tried to figure out what's happening. Well, setValidity() behaves not as I would expect (something about the
2020 Feb 18
2
Possible Regression in setClassUnion between 3.5.0 and 3.6.0
I am trying to create a class union of class unions to facilitate method dispatch. When I execute code in the global environment, everything acts as expected, however when I put the same code in the context of a package, selectMethod can no longer find the correct method. This first block below puts the code in the context of a package: fn <- "codefile.R" writeLines( c(