similar to: S4 method dispatch and namespaces: why is default method selected

Displaying 20 results from an estimated 4000 matches similar to: "S4 method dispatch and namespaces: why is default method selected"

2008 May 23
1
seeing an S4 method, not using it
Dear list, here is a problem I met when trying to use a method for an S4 object, without loading the package in which the method was defined. I do not know if this is a bug, or a mistake of mine. Normally, I think the package in which the appropriate method is defined is loaded automatically when calling the method. The problem is that if the package is indeed loaded automatically, the
2003 Sep 02
2
identify with image
Hola! I will want to identify pixels in an image with the mouse, for so getting the image data from the matrix(es), for use in subsequent discriminant analysis. But the following bombs R: (windows XP, rw1071) > str(baboon) list() - attr(*, "size")= int [1:2] 512 512 - attr(*, "cellres")= num [1:2] 1 1 - attr(*, "bbox")= num [1:4] 0 0 512 512 - attr(*,
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
2003 Sep 18
2
Place a graphic into an R-plot
I have a graphic image in a file (say a *.jpeg or *.png file) and want to put it into a plot. I have segmented the plot area by means of the layout function and successfully plotted my data in the appropriate segments. I cannot find how to put my graphic image onto the same plot. Searching the archives has shed little light on my challenge. Many thanks in anticipation. Gordon > version
2005 Aug 04
3
how to read individual values from a pixmap object
Hi All, I have a greyscale image that I am reading in through RGDAL and placing in a pixmap object. As an example use the logo.jpg file that comes with the RGDAL package: #Read the file logo <- system.file("pictures/logo.jpg", package="rgdal")[1] x <- new("GDALReadOnlyDataset", logo) #Create the pixmap object xGrey <- getPixmapGDAL(x) Now I would
2003 Sep 03
0
identify() seg.faults (PR#4057)
Full_Name: Roger Bivand Version: 1.7.1 OS: i686-pc-linux-gnu Submission from: (NULL) (129.177.30.18) identify() seg.faults when x is an empty list, when the n argument is given a positive value, avoiding the check for non-positive n (n <- length(x) when x is the non-existent x component of the empty list, and when neither x nor y are components of the list. suggested resolution: add test in
2008 Aug 26
1
Dramatic slowdown of R 2.7.2?
Dear R users/developers, simple comparison of code execution time of R 2.7.1 and R 2.7.2 shows a dramatic slowdown of the newer version. Rprof() identifies .Call function as a main cause (see the code below). What happened with R 2.7.2? Kind regards Marek Wielgosz Bayes Consulting ######### Probably useful info ############### ### CPU: Core2Duo T 7300, 2 GB RAM ### WIN XP ### both standard
2007 Mar 13
3
inconsistent behaviour of add1 and drop1 with a weighted linear model
Dear R Help, I have noticed some inconsistent behaviour of add1 and drop1 with a weighted linear model, which affects the interpretation of the results. I have these data to fit with a linear model, I want to weight them by the relative size of the geographical areas they represent. _________________________________________________________________________________________ > example
2007 Apr 29
1
[debug] package - Error in all.levs (PR#9638)
Dear All, I encountered the following problem: fun1 <- function(x){ 2*cos(x) } >library(debug) > mtrace(fun1) > fun1(0.1) Error in all.levs[[j]] : subscript out of bounds > sessionInfo() R version 2.5.0 (2007-04-23) i386-pc-mingw32 locale: LC_COLLATE=Polish_Poland.1250;LC_CTYPE=Polish_Poland.1250; LC_MONETARY=Polish_Poland.1250;LC_NUMERIC=C;LC_TIME=Polish_Poland.1250 attached
2003 Sep 26
2
overlay two pixmap
Hi I need to overlay two pixmaps (library (pixmap)). One, a pixmapGrey, is the basis, and on this I need to overlay a pixmapIndexed, BUT: the pixmapIndexed has set only some of its "pixels" to an indexed color, many of its pixels should not cover the basis pixmapGrey pixel, means, for this "in pixmapIndexed not defined pixels" it should be transparent. What would you
2013 Mar 22
2
read.pnm question in R-beta
In R-beta (Masked Marvel), when I do the example from the read.pnm help file, this is what happens: x <- read.pnm(system.file("pictures/logo.pgm",package="pixmap")[1]) Warning message: In rep(cellres, length=2): x is NULL so the result will be NULL In R-2.15.3, it's all right. Thanks, Erin Erin M. Hodgess, Ph.D. Associate Professor Department of Computer and
2004 Aug 12
4
truly object oriented programming in R
Good morning! I recently implemented a KD tree in JAVA for faster kernel density estimation (part of the code follows). It went well. To hook it with R, however, has proved more difficult. My question is: is it possible to implement the algorithm in R? My impression seems to indicate no as the code requires a complete class-object framework that R does not support. But is there an R package or
2003 Sep 30
2
using identify() together with plot () and pixmap()
Dear R users I have a two-dimensional array, whose values I want to plot, using the pixmapGrey class. Plotting works fine, and now I would like to be able to identify some of the points in the plot using identify(). But I get the following message while pressing the left mouse button: > plot(pixmapGrey(fmri.vtc[,,slice,volume])) > identify(fmri.vtc[,,slice,volume]) warning: no point with
2013 Feb 21
2
error with bbox for k12hat (splancs) bivarite k-function
Hello, I am trying to conduct a bi-variate ripley's k using the k12hat function in the splancs package (found here http://rss.acs.unt.edu/Rdoc/library/splancs/html/k12hat.html). Although, I receive an error when getting to the bboxx part of the code: poly <- list(x=c(fire4$X, nar4$X), y=c(fire4$Y, nar4$Y)) plot(seq(5,80,5), sqrt(k12hat(fire4), as.points(nar4),
2012 Mar 16
1
ggmap crash
Not sure if this is the right place to report this, but: Am using ggmap to generate a map of a bounding box from 161 latitude/longitude pairs and the code crashes R (in ess). Data is at http://analysis.d8u.us/~hdiwan/plotSource.csv and the code to read it is below. I'm not sure if ess, emacs, ggmap, R, or my laptop is to blame. Here's the code: > rmc <-
2005 Dec 07
1
Dots argument in apply method
Hello everyone, I'm working on a package using S4 classes and methods and I ran into the following "problem" when I tried to create an "apply" method for objects of one of my new classes. I've found a way around the problem but I wonder if I did not paint myself into the corner. I'd like your opinion about that. So I have an object "myObj" of class
2007 Mar 30
2
Replacing slot of S4 class in method of S4 class?
Dear all, Assume that I have an S4 class "MyClass" with a slot "myname", which is initialized to: myname="" in method("initialize"): myclass <- new("MyClass", myname="") Assume that class "MyClass" has a method "mymethod": "mymethod.MyClass" <- function(object, myname=character(0), ...) {
2011 Oct 31
1
Question about copying reference objects using the initialize method
Dears, I have a question about copying reference objects using the initialize method. 1) If the latter has no arguments, there is no problem to copy an object. myClass = setRefClass("myClass", fields = list(value = "numeric") ) myClass$methods(initialize = function(...){ ? value <<- 1 ? callSuper(...) }) newObject = myClass$new() newObject$value = 2 copyObject =
2011 Dec 07
2
How to scale arrows to approximately fill a plot region?
In a variety of graphic applications, I plot some data, together with arrows representing variables or linear transformations of variables as vectors in the same space, as in a biplot. In my applications, the scale of the arrows is arbitrary -- all that matters is relative length. I'd like to blow them up or shrink them to fit the available space in the plot. The origin is typically at
2004 May 13
2
watermarks
Hi, I would like to plot a graph which sits in the background as a watermark with other plots in the foreground - on top. I have looked through the threads on the r-project website but they seem to concern background colours rather than actual background plots. I have also searched through the demo's and pars but can't find any eg's any ideas - I only want to plot a simple graph