Re: [R] binary operators that never return missing values

2012-06-20 Thread David Winsemius
On Jun 20, 2012, at 5:18 PM, Anthony Damico wrote: Thanks Michael, I was hoping to complete this in one step (since I use these a lot). Setting the class of the vectors seems like more typing than just doing %>F% ... Unfortunately, my knowledge of classes, methods, and the like is pretty sha

Re: [R] binary operators that never return missing values

2012-06-20 Thread Duncan Murdoch
On 12-06-20 4:44 PM, Anthony Damico wrote: Hi, I work with data sets with lots of missing values. We often need to conduct logical tests on numeric vectors containing missing values. I've searched around for material and conversations on this topic, but I'm having a hard time finding anything.

Re: [R] binary operators that never return missing values

2012-06-20 Thread Rui Barradas
Hello, again. I have two apologies, to the list for having forgotten to cc my previous reply to this thread, and to you for not having understood that you wanted it solved in one step. My solution would need two steps. Now revised. no.na <- function(x, value=FALSE){x[is.na(x)] <- value; x}

Re: [R] binary operators that never return missing values

2012-06-20 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Anthony Damico > Sent: Wednesday, June 20, 2012 2:19 PM > To: R. Michael Weylandt > Cc: r-help@r-project.org > Subject: Re: [R] binary operators th

Re: [R] binary operators that never return missing values

2012-06-20 Thread R. Michael Weylandt
On Wed, Jun 20, 2012 at 4:18 PM, Anthony Damico wrote: > Thanks Michael, > > I was hoping to complete this in one step (since I use these a lot). > Setting the class of the vectors seems like more typing than just > doing %>F%  ... Hmmm. my way save you 3 characters (and three shifts!) per co

Re: [R] binary operators that never return missing values

2012-06-20 Thread Anthony Damico
Thanks Michael, I was hoping to complete this in one step (since I use these a lot). Setting the class of the vectors seems like more typing than just doing %>F% ... Unfortunately, my knowledge of classes, methods, and the like is pretty shaky. Is it possible to *create* another set of operator

Re: [R] binary operators that never return missing values

2012-06-20 Thread R. Michael Weylandt
Hi Anthony, No, I don't believe this exists on CRAN already (happy to be proven wrong though) but I might suggest you approach things a different way: instead of defining this operator by operator with infix notation, why not go after `+`, `>` directly? If you put a class on your vectors, you can

Re: [R] binary operators that never return missing values

2012-06-20 Thread John Kane
gt; Subject: [R] binary operators that never return missing values > > Hi, I work with data sets with lots of missing values. We often need > to conduct logical tests on numeric vectors containing missing values. > I've searched around for material and conversations on this to

[R] binary operators that never return missing values

2012-06-20 Thread Anthony Damico
Hi, I work with data sets with lots of missing values. We often need to conduct logical tests on numeric vectors containing missing values. I've searched around for material and conversations on this topic, but I'm having a hard time finding anything. Has anyone written a package that deals with