Dear Brigid,
Try:
pmin(a,b)
HTH,
Jorge
On Tue, Dec 9, 2008 at 11:58 AM, Brigid Mooney <[EMAIL PROTECTED]> wrote:
> I was surprised this morning, that it seems as though the min() function
> does not work as *I* anticipated when given vector arguments.
>
> For example:
> a <- 1:10
> b <- c(r
Try this:
pmin(a, b)
On Tue, Dec 9, 2008 at 2:58 PM, Brigid Mooney <[EMAIL PROTECTED]> wrote:
> I was surprised this morning, that it seems as though the min() function
> does not work as *I* anticipated when given vector arguments.
>
> For example:
> a <- 1:10
> b <- c(rep(1, times=5), rep(10,
I was surprised this morning, that it seems as though the min() function
does not work as *I* anticipated when given vector arguments.
For example:
a <- 1:10
b <- c(rep(1, times=5), rep(10, times=5))
Result:
> min(a,b)
1
What I actually wanted was a term by term minimum, i.e.:
ifelse(a<=b, a, b
3 matches
Mail list logo