When creating a package, I would like a way to tell R that
a function with a period in its name is not a method.
I'm writing a package now with a modified version of qr.R.
R CMD check gives warnings:
* checking S3 generic/method consistency ... WARNING
qr:
function(x, ...)
qr.R:
function(qr,
I suggest adding a 'pivot' argument to qr.R, to obtain columns in the
same order as the original x, so that
a <- qr(x)
qr.Q(a) %*% qr.R(a, pivot=TRUE)
returns x.
--
# File src/library/base/R/qr.R
qr.R <- function(qr, complete = FALSE, pivot = F
On 07.09.2012 17:05, Tim Hesterberg wrote:
When creating a package, I would like a way to tell R that
a function with a period in its name is not a method.
You can't. There are few exception for historic names (S definitions)
hardcoded in R.
Best,
Uwe
I'm writing a package now with a
On 9/7/12 12:55 PM, "Uwe Ligges" wrote:
>On 07.09.2012 17:05, Tim Hesterberg wrote:
>> When creating a package, I would like a way to tell R that
>> a function with a period in its name is not a method.
>
>You can't. There are few exception for historic names (S definitions)
>hardcoded in R.
>
Would a workaround (for pleasing R CMD check) be to do:
qr.R <- function(...) UseMethod("qr.R", ...)
qr.R.qr <- function(qr, complete, pivot) {
# No need to assert the class of 'qr' here.
...
}
Haven't tried it. Method dispatching may also add unnecessary
overhead if called lots of times.
On Sep 7, 2012, at 12:59 PM, "Warnes, Gregory"
wrote:
>
> On 9/7/12 12:55 PM, "Uwe Ligges" wrote:
>
>> On 07.09.2012 17:05, Tim Hesterberg wrote:
>>> When creating a package, I would like a way to tell R that
>>> a function with a period in its name is not a method.
>>
>> You can't. There ar
On 07/09/2012 2:00 PM, Simon Urbanek wrote:
On Sep 7, 2012, at 12:59 PM, "Warnes, Gregory"
wrote:
>
> On 9/7/12 12:55 PM, "Uwe Ligges" wrote:
>
>> On 07.09.2012 17:05, Tim Hesterberg wrote:
>>> When creating a package, I would like a way to tell R that
>>> a function with a period in its name
On Sep 7, 2012, at 2:14 PM, Duncan Murdoch wrote:
> On 07/09/2012 2:00 PM, Simon Urbanek wrote:
>> On Sep 7, 2012, at 12:59 PM, "Warnes, Gregory"
>> wrote:
>>
>> >
>> > On 9/7/12 12:55 PM, "Uwe Ligges" wrote:
>> >
>> >> On 07.09.2012 17:05, Tim Hesterberg wrote:
>> >>> When creating a package
On Sep 7, 2012, at 17:16 , Tim Hesterberg wrote:
> I suggest adding a 'pivot' argument to qr.R, to obtain columns in the
> same order as the original x, so that
> a <- qr(x)
> qr.Q(a) %*% qr.R(a, pivot=TRUE)
> returns x.
That would come spiraling down in flames the first time someone tried to