[R] How to define new operator in R?

David Winsemius dwinsemius at comcast.net
Wed Mar 30 21:33:14 CEST 2011


On Mar 30, 2011, at 11:04 AM, Chuanlong Du wrote:

> Hello, everyone!
>
> Does anyone know how make some symbols have special means in R? For  
> example,
> we know that "+" in R means the sum of the two operand on its left and
> right. I want to define some operators in R by myself. Is this  
> possible?

You can create your own infix operators by surrounding them with  
matching percent signs:
`%`

?"%in%"

-- 
David Winsemius, MD
Heritage Laboratories
West Hartford, CT



More information about the R-help mailing list