Skip to content
Back to formatted view

Raw Message

Message-ID: <loom.20131110T181820-595@post.gmane.org>
Date: 2013-11-10T17:49:14Z
From: Charles C. Berry
Subject: Custom Numeric type in R

Christofer Bogaso <bogaso.christofer <at> gmail.com> writes:

> 
> Hi again,
> 
> In R, there are various numerics like, NA, Inf, or simple integers etc.
> However I want to include one custom type: "TBD", which R should treat as
> numeric, not character.
> 
> That "TBD" should have same property like Inf, however except this: TBD -
> TBD = 0
> 
> In future, I am planning to add few more properties to TBD.
> 
> Can somebody guide me if this is possible in R, ans also some pointer on
> how can be done in R
> 

Possible? Yes.

Your question might be framed as 

"How do I create a class and write a method for '-' that does ... ?"

The answer is "learn about methods and classes in R".

To get started, see

 ?methods
 ?class
 ?groupGenericFunction-class
 ?groupGeneric

and follow the links therein.


Check the posting guide. If you need to follow up, you should consider
whether the question you have fits better on R-devel.