Learn R Programming

rimu (version 0.6)

mrequal: Check if a level or levels is present

Description

Returns vector of TRUE or FALSE according to whether y is onle of the levels present for that row or is the only level present for that row.

Usage

x %has% y
x %hasonly% y
x %hasall% ys
x %hasany% ys

Value

Logical vector

Arguments

x

mr object

y

character vector specifying a level

ys

character vector specifying one or more levels

Examples

Run this code
data(ethnicity)

ethnicity
ethnicity %has% "Maori"
ethnicity %hasonly% "Maori"

data(nzbirds)
as.mr(nzbirds) 
as.mr(nzbirds) 

Run the code above in your browser using DataLab