Displaying 20 results from an estimated 10000 matches similar to: "truncate"
2001 Oct 01
1
generic default values
I have a generic function
test.equal <- function(obj1, obj2, ...) UseMethod("test.equal")
however, the only argument that specific methods use is "fuzz" so I
would like to change this to
test.equal <- function(obj1, obj2, fuzz=???) UseMethod("test.equal")
The problem is that some methods use slightly different default values
for fuzz than others. How should
2011 Feb 03
1
S3 method for S4 object
I am trying to extend an S3 method to work with an S4 object as well as the S3 objects it works with, but UseMethod does not seem to recognize the S4 class and dispatches to the default method. Is this to be expected or should I be looking for an error in my code?
If it is not an error in my code, is there an easy way to do this, or do I have to convert the generic to S4 and then make those
2005 Apr 11
0
exists("loadings.default") ...
Paul Gilbert asked me the following, about a topic that was
dealt here (on R-devel) a few weeks ago (~ March 21):
>>>>> "PaulG" == Paul Gilbert <pgilbert@bank-banque-canada.ca>
>>>>> on Mon, 11 Apr 2005 10:35:03 -0400 writes:
PaulG> Martin, a while ago you suggested:
>> For S3, it's a bit uglier, but I think you could still
1999 Apr 16
1
NextMethod
>> One clear moral seems to be don't do anything more inside a
>> generic function than you really need to do. Keep it *very*
>> simple indeed.
>>
> I recall JMC saying something like, all generic functions
> should be one line long; a call to the appropriate UseMethod.
It certainly is encouraging to know that others also have been confused by
aspects of
2005 Mar 20
1
loadings generic?
Can loadings in stats can be made generic?
Paul Gilbert
2001 Aug 15
1
documented but missing from the code (PR#1054)
In R-devel (Aug 15) I am getting some warnings
"Objects documented but missing from the code:"
The ones I have checked are definitely in the code, so I suspect there is a bug in
this check. I'm very busy today and then away until after the projected release of
the new version so I cannot follow up on this as carefully as I would like to. I
expect the problem is reproducible with dse
1998 Apr 24
1
Warning: ignored non function "scale"
I've been working on a revised version of prcomp and princomp. Below is my
current draft of prcomp, which is marginally different from V&R. I've added
center and scale as optional arguments. However, scale causes the following:
> zi _ prcomp(iris[,,2])
Warning: ignored non function "scale"
because scale is both a variable and a function. Is there any way to avoid this
2000 Jun 29
1
Binary file functions in R
This is just to let people know that I'm going to try to put together
a little package of binary file read/write functions for R, along the
lines described in my message in r-help. I'm going to do it first in
R for Windows using a DLL written in Delphi; I'll let people comment
on that, and once the design settles down, I'll redo the external code
in C so that it should be portable
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
Suggestion for exception handling: More informative error message for "no applicable method..." (S3)
2009 Oct 20
1
Suggestion for exception handling: More informative error message for "no applicable method..." (S3)
I'd like to suggest that whenever there is no S3 method implementation
available for a particular class, that the error message would also
report the class structure of the object dispatched on.
Example:
foo <- function(...) UseMethod("foo")
foo.ClassA <- function(object, ...) { cat("foo() for ClassA called.\n") }
> foo(structure(1, class="ClassA"))
2000 Oct 04
3
R 1.2 build
I've been trying to build a bundle with the R-devel snapshot from
yesterday. (Yes I know it is unstable and just tell me if I shouldn't be
trying to do this yet.)
It is failing with the message
tar : /dev/rmt/0 : Permission denied
It happens after "removing junk files" and just after the message
"building dse_2000.9-1.tar.gz"
It looks to be coming from the line in
2006 May 19
1
UseMethod infelicity
If I do
> example(lm)
...
> mycoef <- function(object, ...) UseMethod("coef", object)
> mycoef(lm.D9)
Error in mycoef(lm.D9) : no applicable method for "coef"
which is pretty surprising, as coef has a default method.
After a bit of digging, this comes from do_usemethod having
defenv = environment where the generic was defined */
defenv =
2001 Nov 16
1
UseMethod() fails to (PR#1176)
match the argument 'x' if there is another argument with prefix 'x'
Full_Name: Henrik Bengtsson
Version: 1.3.1
OS: Sun Solaris 8
Submission from: (NULL) (130.235.3.49)
I ran into a strange problem with UseMethod(). Run the following code:
foo.Bar <- function(this, x=0, xidx=0) {
cat("In foo.Bar(): ", this, ", x=", x, ", xidx=", xidx,
2005 Jun 08
1
FW: Random seed problem in MCMC coupling of chains
And a last post from Paul Gilbert. Thanks to all! This disscusion was
really beneficial for me!
-----Original Message-----
From: Paul Gilbert [mailto:pgilbert at bank-banque-canada.ca]
Sent: sre 2005-06-08 21:01
To: Gorjanc Gregor
Subject: Re: [R] Random seed problem in MCMC coupling of chains
Gorjanc Gregor wrote:
> Thanks to Paul and Gabor for additional tips/examples. Actually, I find
2001 Jun 12
1
trouble to install the Rstream package
Dear R-users,
I successfully installed the package Rstreams under linux, but my first
attempt to do so on SGI IRIX 6.5 (64bits) lead to the following error
message.
--------------------
laurent at genome> R CMD INSTALL Rstreams
Installing source package `Rstreams' ...
creating cache ./config.cache
checking for ftruncate... yes
checking size of long double... 16
updating cache
2007 May 30
2
S4 assignment \alias and \usage
What is the Rd file alias and usage syntax for an S4 assignment method?
I have been trying variations on
\alias{TSdoc<-,default-method}
\usage{
\S4method{TSdoc}{default}(x) <- value
but so far I have not got it right according to various codoc, etc, checks.
Paul Gilbert
====================================================================================
La version fran?aise
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"?
2001 Jun 01
1
Installing Rstreams lib
Dear R-helpers,
I am trying to install Rstreams library on the following platform:
----------------------------
platform alphaev67-dec-osf5.0
arch alphaev67
os osf5.0
system alphaev67, osf5.0
status
major 1
minor 2.3
year 2001
month 04
day 26
language R
---------------------------
Unfortunately, I get these error messages:
---------------------------
> [557] R
2000 Nov 14
2
library doubt
Hi all.
I'm trying to install the packages Rstreams and RPgSQL, but with no
success.
I did R INSTALL name package but if I try library(Rstreams) I get the
following error:
Error in library.dynam("Rstreams",pkg,lib):
dynamic library 'Rstreams' not found
Error in library(Rstreams): .First.lib failed
Where did I go wrong? I'm using R 1-1-1 on a Debian GNU/Linux box.
2001 Sep 28
2
problems with new checks in R-devel
Below are a few problems I have encountered with the new checks
being done in R-devel.
1/ I have two generics, test.equal and test.equal.tframe. The
first checks that two objects are equal while the second checks
if two objects have equal tframes (time frames). There is no
reason these should have similar arguments but the check seems to
think that test.equal.tframe is a method for test.equal so