search for: getslots

Displaying 7 results from an estimated 7 matches for "getslots".

2006 Mar 09
1
count pixels of same color in pixmap object?
Dear all, I try to figure out how to use R to count the number of pixels of the same color in some gray-level picture. I managed to read it in either tiff or jpeg format, but the returned pixmap object keeps its information out of (my) reach. Is there an easy way to tabulate the different color/graylevel pixels and their numbers? Or should I use a completely different (free) software?
2008 Mar 15
1
length of S4
Hi the list, With basic type, length gives the length of the vector Wtih list, length gives the number of item With S4 object, length gives...one. Even with an objet with empty slot. setClass("E",representation(e="numeric")) [1] "E" length(new("E")) [1] 1 setClass("E",representation(e="matrix")) [1] "E"
2004 Jul 28
2
Simulation from a model fitted by survreg.
Dear list, I would like to simulate individual survival times from a model that has been fitted using the survreg procedure (library survival). Output shown below. My plan is to extract the shape and scale arguments for use with rweibull() since my error terms are assumed to be Weibull, but it does not make any sense. The mean survival time is easy to predict, but I would like to simulate
2004 Nov 26
1
Testing for S4 objects
Dear r-help list members, Is there a way to test whether an object is an S4 object? The best that I've been able to come up with is isS4object <- function(object) !(is.null(slotNames(object))) which assumes that an S4 object has at least one slot. I think this is safe, but perhaps I'm missing something. Thanks, John -------------------------------- John Fox Department of
2004 Nov 26
1
Testing for S4 objects
Dear r-help list members, Is there a way to test whether an object is an S4 object? The best that I've been able to come up with is isS4object <- function(object) !(is.null(slotNames(object))) which assumes that an S4 object has at least one slot. I think this is safe, but perhaps I'm missing something. Thanks, John -------------------------------- John Fox Department of
2013 Jan 30
0
ROxygen2-Documenting of S4 Method
...hods #' @name set-methods #' @aliases set<-,rcfpdsuperclass,character,rcfpdsuperclass- method,character-method setReplaceMethod( "set", signature = signature(object = "rcfpdsuperclass",slot="character"), definition = function(object,slot,value){ if(getSlots(class(object))[slot] == "RcfpdStoredObject"){ slot(object,slot) <- storeObject(value) } else { slot(object,slot) <- value } invisible(validObject(object)) return(object) })
2005 Jan 18
1
"Attach" for S4 objects?
When passing a list as an argument to a function, I find it convenient to attach it in the first line of th function code, then refer to the components as A, B, etc. rather than as list$A, list$B, etc. If I pass a S4 class object, is there a way to "attach" it, or do I have to refer to the slots as object at A, objetc at B, etc.? I could always make copies, A <- object at A