Skip to content
Back to formatted view

Raw Message

Message-ID: <CAM_vjumaRCbzo1iEJ1y7Kh2odiuO5xrBbHReHYha1MXrCWawbA@mail.gmail.com>
Date: 2012-12-17T20:38:26Z
From: Sarah Goslee
Subject: How to test whether is.element() returns only TRUE's
In-Reply-To: <7953BA1D7779E746994B38A00362416C1667A853@exch-mbx-02.utu.fi>

With all().

> all(is.element(c(1,4,2),c(1,2,3)))
[1] FALSE

Sarah

On Mon, Dec 17, 2012 at 3:24 PM, Atte Tenkanen <attenka at utu.fi> wrote:
> Hi,
>
> How can I test, whether all the values that is.element() -function returns are TRUE's
>
> Eg.
>> (is.element(c(1,4,2),c(1,2,3)))
> [1]  TRUE FALSE  TRUE
>
> This doesn't work:
>
>> (is.element(c(1,4,2),c(1,2,3)))==TRUE
> [1]  TRUE FALSE  TRUE
>
> Best,
>


--
Sarah Goslee
http://www.functionaldiversity.org