Displaying 20 results from an estimated 20000 matches similar to: "UseMethod() fails to (PR#1176)"
2001 Nov 16
0
Best/safest way to use UseMethod()?
I raised the questions below a couple of months ago by sending it to the developers mailing list, but I don't know if it got through since no one replied to it.
Looking at the [R] distribution, the UseMethod() is used in the following way:
alias <- function(object, ...) UseMethod("alias")
or
barplot <- function(height, ...) UseMethod("barplot")
What I
2004 Nov 15
1
UseMethod call with no arguments
Dear R developers,
I will ask a very straightforward question concerning UseMethod's future,
because people depending on my code wonder what will happen to it next.
In R v2.0.1 NEWS it says
o The undocumented use of UseMethod() with no argument is now
formally deprecated.
and in the R v2.0.1 help(UseMethod) it says
'UseMethod' accepts a call with no arguments and tries to
2012 Oct 17
1
Do *not* pass '...' to NextMethod() - it'll do it for you; missing documentation, a bug or just me?
Hi,
although I've done S3 dispatching for more than a decade now, I think
I managed to overlook/avoid the following pitfall when using
NextMethod():
If you explicitly pass argument '...' to NextMethod(), you will
effectively pass those argument twice to the "next" method!
EXAMPLE:
foo0 <- function(...) UseMethod("foo0");
foo1 <- function(...)
2003 Sep 03
1
Last line in .Rprofile must have newline (PR#4056)
Full_Name: Henrik Bengtsson
Version: R v1.7.1
OS: WinXP Pro, Solaris 9
Submission from: (NULL) (130.235.2.229)
A colleague of mine who is new to R had problems setting up his .Rprofile and we
tracked it down to the following. On both WinXP and Solaris with Rv1.7.1 we
noticed that the *last* line in .Rprofile has to have a *newline* to be
evaluated. For instance, starting R with the following
2002 Oct 13
1
The class attribute on an environment seems buggy (PR#2159)
Full_Name: Henrik Bengtsson
Version: 1.6.0, 1.5.1
OS: WinXP Pro
Submission from: (NULL) (128.250.252.82)
The following example, which I tested on both R v1.5.1 and R v1.6.0 on WinXP
Pro, shows the problem I encountered when trying to use the class attribute of
an environment:
# Define method print() for class Environment
C
print(e)
# gives:
# [1] "An Environment!"
# Exit [R]
2002 Aug 06
1
write.table() adds unnecessary spaces to right align integer column
When using write.table() to write data frames the integer columns are padded
with unnecessary spaces (0x20) so that these columns are right align if you
look at them in a text editor. However, I think it is quite a vast of file
size. For instance, I am reading a tab-delimited 4200kb microarray data file
and writing it back verbatim using write.table() and it becomes 5100kb, a
20% increase. Is this
2019 Jun 27
2
methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true error
Using:
untrace(methods::conformMethod)
at <- c(12,4,3,2)
str(body(methods::conformMethod)[[at]])
## language omittedSig <- omittedSig && (signature[omittedSig] != "missing")
cc <- 0L
trace(methods::conformMethod, tracer = quote({
cc <<- cc + 1L
print(cc)
if (cc == 31) { ## manually identified
untrace(methods::conformMethod)
2001 Sep 15
1
Solution to (well known) problem with Rdconv.pm on Sun Solaris (PR#1093)
Full_Name: Henrik Bengtsson
Version: 1.3.1
OS: Sun Solaris 8
Submission from: (NULL) (130.235.3.49)
I have been trying to install [R] v1.3.1 locally on a Sun Solaris 8 machine and
I ran into the (already known) perl problems that express theselves as:
Bare word found where operator expected at
/usr/matcent/hb/R/R-1.3.1/share/perl/R/Rdconv.pm line 1390, near "$txtout
mywrap"
2002 Feb 28
2
Failed file("foo", "r") keeps file open? (PR#1333)
Full_Name: Henrik Bengtsson
Version: R v1.4.0
OS: Solaris 8
Submission from: (NULL) (130.235.3.49)
When I am trying the following on Rv1.4.0 on Solaris 8, I get that the
"cannot close output sink connection":
% R --vanilla
tmpfile <- tempfile() # Create a filename that does not exist
for(k in 1:100) {
cat(k, ": ");
try(fh <- file(tmpfile, "r"))
2012 Dec 04
1
inconsistencies between ?class and ?UseMethod
Hi,
The 2 man pages give inconsistent description of class():
Found in ?class:
If the object does not have a class attribute, it has an implicit
class, ?"matrix"?, ?"array"? or the result of ?mode(x)? (except
that integer vectors have implicit class ?"integer"?).
Found in ?UseMethod:
Matrices and arrays have class ?"matrix"?
2004 Jul 16
3
Strange (non-deterministic) problem with strsplit
I'm having an odd problem with strsplit (well I think it's strplit
that's causing the problem). When I run the code below as follows:
str(parseFormulaMin(y +x +d ~ b +d +e| a * b))
I expect to get
List of 3
$ y: chr "y+x+d"
$ x: chr "b+d+e"
$ g: chr "a*b"
But about half the time I get
List of 3
$ y: chr "y+x+d"
$ x: chr
2004 Jul 16
3
Strange (non-deterministic) problem with strsplit
I'm having an odd problem with strsplit (well I think it's strplit
that's causing the problem). When I run the code below as follows:
str(parseFormulaMin(y +x +d ~ b +d +e| a * b))
I expect to get
List of 3
$ y: chr "y+x+d"
$ x: chr "b+d+e"
$ g: chr "a*b"
But about half the time I get
List of 3
$ y: chr "y+x+d"
$ x: chr
2023 Oct 30
2
dim<-() changed in R-devel; no longer removing "dimnames" when doing dim(x) <- dim(x)
>>>>> Henrik Bengtsson
>>>>> on Sun, 29 Oct 2023 10:42:19 -0700 writes:
> Hello,
> the fix of PR18612
> (https://bugs.r-project.org/show_bug.cgi?id=18612) in
> r85380
> (https://github.com/wch/r-source/commit/2653cc6203fce4c48874111c75bbccac3ac4e803)
> caused a change in `dim<-()`. Specifically, in the past,
2018 Aug 13
1
substitute() on arguments in ellipsis ("dot dot dot")?
Since you're already using bang-bang ;)
library(rlang)
dots1 <- function(...) as.list(substitute(list(...)))[-1L]
dots2 <- function(...) as.list(substitute(...()))
dots3 <- function(...) match.call(expand.dots = FALSE)[["..."]]
dots4 <- function(...) exprs(...)
bench::mark(
dots1(1+2, "a", rnorm(3), stop("bang!")),
dots2(1+2, "a",
2012 Jul 31
1
kernlab kpca predict
Hi!
The kernlab function kpca() mentions that new observations can be transformed by using predict. Theres also an example in the documentation, but as you can see i am getting an error there (As i do with my own data). I'm not sure whats wrong at the moment. I haven't any predict functions written by myself in the workspace either. I've tested it with using the matrix version and the
2019 Jul 01
1
methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true
I run checks with R-devel rev. 76756 on several of my packages which use S4, with no ill effects.
With the risk of not adding much, it seems that Martin's example, which I repeat below, suggests a crossover between several "signatures" involved here - the signature of the generic, the signature of the method (the argument for setMethod()), and the signature of the function object
2023 Oct 31
1
dim<-() changed in R-devel; no longer removing "dimnames" when doing dim(x) <- dim(x)
Hi Martin, Henrik,
I actually like this change.
Makes a lot of sense IMO that dim(x) <- dim(x) be a no-op, or, more
generally, that foo(x) <- foo(x) be a no-op for any setter/getter combo.
FWIW S4Arrays::set_dim() does that too. It also preserves the dimnames
if the right value is only adding or dropping outermost (ineffective)
dimensions:
??? > x <- array(1:6, dim=c(2,3,1),
2019 Nov 18
2
BUG?: A copy of base::`+` (primitive) is not a clone but a "pointer"
On 11/18/19 9:18 AM, Martin Maechler wrote:
>>>>>> Henrik Bengtsson
>>>>>> on Sun, 17 Nov 2019 14:31:07 -0800 writes:
> > $ R --vanilla R version 3.6.1 (2019-07-05) -- "Action of
> > the Toes" Copyright (C) 2019 The R Foundation for
> > Statistical Computing Platform: x86_64-pc-linux-gnu
> > (64-bit) ...
2007 Oct 15
2
Digest package - make digest generic?
On 10/15/07, Henrik Bengtsson <hb at maths.lth.se> wrote:
> [As agreed, CC:ing r-devel since others might be interested in this as well.]
>
> Hi.
>
> On 10/15/07, Dirk Eddelbuettel <edd at debian.org> wrote:
> >
> > Hi Hadley,
> >
> > On 15 October 2007 at 09:51, hadley wickham wrote:
> > | Would you consider making digest a generic
2019 Jun 28
2
methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true error
> On 28 Jun 2019, at 16:03 , Martin Maechler <maechler at stat.math.ethz.ch> wrote:
>
>>>>>> Henrik Bengtsson
>>>>>> on Thu, 27 Jun 2019 16:00:39 -0700 writes:
>
>> Using:
>>
>> untrace(methods::conformMethod)
>> at <- c(12,4,3,2)
>> str(body(methods::conformMethod)[[at]])
>> ## language omittedSig