Displaying 20 results from an estimated 5000 matches similar to: ""[", .local and S4 methods (was: "[" operator and indexing ambiguity)"
2009 Feb 25
1
Unexpected side effect of the ":::" operator on the value of isGeneric
Hi,
when running the following on a fresh R,
library("IRanges")
annotation
showMethods("annotation")
Biobase:::annotation
showMethods("annotation")
I get (see the "^^^^^" marked output at the bottom):
> library("IRanges")
Carico il pacchetto richiesto: 'IRanges'
The following object(s) are masked from package:base :
2010 May 21
1
S4 method defined but not used
Dear R developers,
I am having a slightly weird issue with a S4 method defined in my package adegenet 1.2-4, with R 2.11.0. As far as I know, the problem is new, and the code implementing the method has not changed for more than a year and worked well so far.
The problem is the following. I define, in the package, a method "[" for the S4 class 'genind'. The method's
2008 Apr 29
2
reproducible segmentation fault caused by textConnection()
Dear all,
It seems that textConnection() can trigger a segmentation fault. The
following script (using two large loops) makes this bug reproducible:
for (i in 1:10000) {
z=textConnection(NULL,open='w')
for (j in 1:100) {
write(runif(1)*1e6,file=z)
write('\n',file=z)
}
close(z)
}
The bug could be reproduced on R-2.6.1, R-2.7.0 and on the latest
R-devel
2018 May 06
0
length of `...`
Does anyone notice r-devel thread "stopifnot() does not stop at first non-TRUE argument" starting with https://stat.ethz.ch/pipermail/r-devel/2017-May/074179.html ?
I have mentioned
(function(...)nargs())(...)
in https://stat.ethz.ch/pipermail/r-devel/2017-May/074294.html .
Something like ..elt(n) is switch(n, ...) . I have mentioned it in
2017 Apr 19
0
Crash after (wrongly) applying product operator on S4 object that derives from list
I think this is a known issue with Java messing with the stack, see
e.g. http://r.789695.n4.nabble.com/Error-memory-exhausted-limit-reached-td4729708.html.
I'll fix the infinite recursion caused by the methods package.
Michael
On Wed, Apr 19, 2017 at 1:12 AM, Wolfgang Huber <wolfgang.huber at embl.de> wrote:
> Dear Hilmar
>
> Perhaps this gives an indication of why the
2018 May 04
1
length of `...`
The one difference I see, is the necessity to pass the dots to the function
dotlength :
dotlength <- function(...) nargs()
myfun <- function(..., someArg = 1){
n1 <- ...length()
n2 <- dotlength()
n3 <- dotlength(...)
return(c(n1, n2, n3))
}
myfun(stop("A"), stop("B"), someArg = stop("c"))
I don't really see immediately how one can
2007 Jan 26
3
"[" operator and indexing ambiguity
Hi,
I am working on writing some S4 classes that represent
multidimensional (brain) image data. I would like these classes to
support standard array indexing. I have been studying the Matrix and
EBImage (http://www.bioconductor.org/packages/1.9/bioc/html/EBImage.html)
packages to see how this is done.
When using objects of the "array" class directly, R distinguishes
between the calls:
2006 Jul 10
1
Unexpected difference in Bounding Box of PDF graphics between (PR#9072)
huber at ebi.ac.uk wrote:
> Full_Name: Wolfgang Huber
> Version: R version 2.4.0 Under development (unstable) (2006-07-09 r38523)
> OS: i686-pc-linux-gnu
> Submission from: (NULL) (62.253.128.15)
>
>
> There appears to be unintentional behaviour in the size of the bounding box for
> PDF graphics produced with the current R2.4, compared to 2.3.1. I posted two PDF
>
2007 Mar 06
2
SVG and tooltips, hyperlinks
Dear all,
is there a good way to create SVG plots with R whose elements have
titles (tooltips) or act as hyperlinks?
I am using the RSvgDevice package, which works great - but it doesn't
seem to support the notion that plot objects have titles or are act as
hyperlinks, so I am helping myself by giving the objects funny unique
colors and then postprocessing the .svg file.
I wonder
2008 Feb 12
4
assigning NULLs to elements of a list
Dear developers:
I have just came across an (unexpected to me) behaviour of lists when
assigning NULLs to list elements. I understand that a NULL is a valid R
object, thus assigning a NULL to a list element should yield exactly the
same result as assigning any other object. So I was surprised when
assigning a NULL in fact removed the element from the list. Is this an
intended behaviour? If
2007 Dec 02
1
sd(NA)
Dear Prof. Ripley
I noted a change in the behaviour of "cov", which is very reasonable:
## R version 2.7.0 Under development (unstable) (2007-11-30 r43565)
> cov(as.numeric(NA), as.numeric(NA), use="complete.obs")
Error in cov(as.numeric(NA), as.numeric(NA), use = "complete.obs") :
no complete element pairs
whereas earlier behavior was, for example:
## R
2013 Dec 05
0
S4 method for '[' with extra arguments: distinguishing between x[i] and x[i, ]
Hi,
I want to implement a '[' for an S4 class, that behaves differently
when called with a single index argument or multiple indexes (possibly
missing), like what happens when subsetting matrices x[i] vs. x[i, ].
I manage to do it using nargs() and checking if drop is missing (see
code below), but when I want to add an extra argument to the method
(before drop), then the parent call
2007 Jan 15
0
Advanced course R programming and Bioconductor in Cambridge UK 30.3.+1.4.
Dear R users & developers,
Seth Falcon and Martin Morgan are teaching
Advanced R Programming and Bioconductor 30 March - 1 April 2007 at the
Wellcome Trust Genome Campus, Hinxton, Cambridge, UK.
This two-day course focuses on programming skills required to develop
software for statistical analysis of high-throughput genomic data using
R and Bioconductor. Lectures and practical sessions
2010 Jan 16
1
"Too many raster images" in devPS.c
Hi,
I am finding the recently added [1] functionality of embedding raster
images into plots on R devices very useful! Thanks to Paul Murrell and
others for providing that. I noted that in
https://svn.r-project.org/R/trunk/src/library/grDevices/src/devPS.c
a macro is defined: #define MAX_RASTERS 64, and consequently, I get
Error in grid.Call.graphics("L_raster", x$raster, x$x, x$y,
2012 Jul 05
1
Extracting srcref for S4 methods
Hi,
on R version 2.15.1 (2012-06-22) (Platform: i686-pc-linux-gnu (32-bit))
sourced functions have srcref attached as an attribute.
Are such data also available for S4 generics and methods? How? (See
sample code below)
Thank you.
Bests,
Renaud
f <- textConnection(
"
f <- function(){}
setGeneric('myfun', function(x, ...) standardGeneric('myfun'))
2010 Sep 03
3
S4 Method Signatures
Hello,
If the signature of a method defines which generic it implements then I'm confused about why this minimal example I invented won't work :
setGeneric("myFun", function(rs, ...){standardGeneric("myFun")})
setGeneric("myFun", function(cs, ...){standardGeneric("myFun")})
setMethod("myFun", "numeric", function(rs, colour =
2010 Oct 26
1
S4 methods for rbind()
Hello.
I am trying to write an S4 method for rbind(). I have a class of objects
called 'mdm', and I want to be able to rbind() them to one another.
I do not want the method for rbind() to coerce anything to an mdm object.
I want rbind(x1,x2,x1,x2) to work as expected [ie rbind() should take any
number of arguments].
This is what I have so far:
setGeneric(".rbind_pair",
2018 Nov 29
3
Unexpected argument-matching when some are missing
On Thu, Nov 29, 2018 at 10:51 AM S Ellison <S.Ellison at lgcgroup.com> wrote:
>
> > When trying out some variations with `[.data.frame` I noticed some (to me)
> > odd behaviour,
>
> Not just in 'myfun' ...
>
> plot(x=1:10, y=)
> plot(x=1:10, y=, 10:1)
>
> In both cases, 'y=' is ignored. In the first, the plot is for y=NULL (so not
2003 Sep 05
2
S4 Method Collisions with "[" (PR#4075)
Full_Name: Colin A. Smith
Version: 1.8.0
OS: Mac OS X 10.2.6
Submission from: (NULL) (216.102.90.18)
Both Biobase and my package annaffy use S4 classes to define methods for "[".
Both packages use the save image method of installation. (See annaffy 1.0.3 in
BioC CVS.)
Depending on how both packages are loaded, the Biobase definitions seem to be
getting masked out:
>
2014 Jul 11
1
Namespaces and S4 Generics
I've installed R-devel
R Under development (unstable) (2014-07-09 r66111)
Platform: x86_64-apple-darwin13.1.0 (64-bit)
and am trying to resolve some problems that I am seeing with my
SparseM package. In prior versions I explicitly had:
setGeneric("image", function(x, ...) standardGeneric("image"))
and then used setMethod to define a method for the class matrix.csr
but