[R] Custom Numeric type in R

Charles Berry ccberry at ucsd.edu
Sun Nov 10 18:49:14 CET 2013


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.



More information about the R-help mailing list