Displaying 17 results from an estimated 17 matches for "parlamis".
2005 Dec 29
1
trouble with S4 methods for group "Summary"
Hello. This question concerns the Methods package. I have created a
new class and am trying to set a method for it for S4 group generic
"Summary". I have run into some signature problems. An example:
> setClass("track", representation(x="numeric", y="character"))
[1] "track"
> setGeneric("max", group="Summary")
2005 Nov 23
3
date/time arithmetic
On the help page "DateTimeClasses {base}" it says:
"One can add or subtract a number of seconds or a difftime object
from a date-time object, but not add two date-time objects."
However,
> x<-Sys.time(); y<-Sys.time()+3600
> diff<-y-x
> x; y; diff
[1] "2005-11-23 19:58:20 GMT"
[1] "2005-11-23 20:58:20 GMT"
Time difference of 1 hours
2005 Oct 12
1
bug checking
...If instead of feeding the function X, I feed it unclass(X) or
as.vector(X) the red color is not applied to the area between the
first and last ticks on the x axis.
Is this a bug, or just a consequence of there not being a plot method
for the class I am trying to feed the function?
Franklin Parlamis
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 2006
month 09
day 22
svn rev 39471
langua...
2006 Sep 23
1
generics for primitive functions
...tion(x) "Works")
[1] "Math"
> getGeneric("sqrt")(4)
`__Deferred_Default_Marker__`
the section in "How Methods Work" that deals with this is unfinished,
but i think it suggests that getGeneric("sqrt")(4) should work out of
the box.
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 2006
month 09
day 22
svn rev 39471
langua...
2006 Oct 20
1
understanding virtual classes and extensions thereof
...ize on method writing. Will
it matter on any level whether my virtual classes have NULL or S4
prototypes?
On a related note, the behavior exhibited below also seems infelicitous
setClass("kid4", contains = "mom")
new("kid4") # error in the show method
franklin parlamis
2006 Oct 11
1
dispatching on group generics with more than one formal
...ic", y = "missing"),
function(x, y) "Special2")
foo(1) # gives the group method
foo2(1) # gives the default method
selectMethod("foo2", signature(x = "numeric", y = "missing")) # but
method selection appears to work correctly
__
franklin parlamis
> version
platform powerpc-apple-darwin8.7.0
arch powerpc
os darwin8.7.0
system powerpc, darwin8.7.0
status
major 2
minor 4.0
year 2006
month 10
day 03
svn rev 39566
language R
version.string R ve...
2006 Sep 14
1
attributes of S4 objects
...ad
analogous slots would appear in any formal objects that extend basic
data types (like the Dim and Dimnames attributes in the 'Matrix'
mother class from the Matrix package).
Is that true? Are attributes un-S4? Any and all style advice or
examples would be appreciated.
Franklin Parlamis
2006 Oct 19
1
default arguments in generics and methods
...ndardGeneric("foo3")},
useAsDefault = FALSE)
setMethod("foo3", signature(x = "missing"), function(x = 3) x)
setMethod("foo3", signature(x = "numeric"), function(x = 3) x^2)
foo() # returns 3
foo2() # returns 1
foo3() # returns 4
___
franklin parlamis
2006 Sep 21
1
validity testing as part of '@<-'
...ly-called coercion method.
library(Matrix)
test <- Matrix(1:4+0.1, nrow = 2, dimnames = list(letters[1:2],
LETTERS[1:2]))
test at Dimnames <- list(1:100)
test
direct slot access (without a validity check) seems an easily
accessible loophole to S4 object "guarantees".
franklin parlamis
2007 Aug 17
0
Hedge Fund Job Opening
...fund and am looking for someone to join me, essentially as the principal quant for a new San Francisco office. I've been very impressed with the posters on this list and am hopeful that some of you will consider submitting your resume for the position.
The job announcement follows.
Franklin Parlamis
(My apologies for posting in both sig-finance and devel -- finance experience is not mandatory)
***
Statistician/Programmer Sought for San Francisco Hedge Fund Office.
Pine River Capital Management (with assets under management in excess of USD 750 million and offices in Minneapolis, London and...
2006 Sep 20
1
residual '*tmp*' variable after "[<-" error
...behavior would be:
(i) if an error occurs, remove the '*tmp*' variable
(ii) report the error as occurring in the original replacement call
(rather than the '*tmp*' replacement, which may be confusing to those
who haven't read the "R Language Definition")
franklin parlamis
> version
_
platform powerpc-apple-darwin8.7.0
arch powerpc
os darwin8.7.0
system powerpc, darwin8.7.0
status alpha
major 2
minor 4.0
year 2006
month 09
day 06
svn rev 39158
langu...
2006 Apr 06
0
algebra
...e total number of unknowns i am dealing with) that would somehow store scalars associated with all the possible combinations of variables? does that thought have a future? (please ignore this last question if i am not, as is often the case, making sense)
thanks in advance for any help.
franklin parlamis
2006 May 02
0
methods for @ operator
...s a primitive function; methods can be defined, but the generic
function is implicit, and cannot be changed. in: setGeneric("@")
however, in this last warning message, R says "methods can be
defined" so i am left with a ray of hope. is there some way to do this?
franklin parlamis
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) <-
2006 Oct 06
1
class unions?
the code below has me confused:
setClassUnion("index", c("numeric", "character", "logical"))
extends("numeric") # i don't see the class union
library(Matrix)
extends("numeric") # now i see the class union
i am aware that the "Matrix" package separately defines the "index"
class union.
is it the case that
2006 Sep 04
1
setMethod("Summary")
Hi everyone and thanks for being patient. I've used "!.foo"() et
seq pro tem.
Next problem: how to define "Summary" methods for brobs.
?max says
'max' and 'min' are generic functions: methods can be defined for
them individually or via the 'Summary' group generic. For this to
work properly, the arguments '...' should be