is.specific: Determine whether the first set 'x' of predicates is more...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/is.specific.R

Description

The function takes two character vectors of predicates and determines whether x is more specific (or equal w.r.t. the specificity) than y. The specificity relation is fully determined with the values of the vars() vector and the specs() incidence matrix that is encapsulated in the given fsets object.

Usage

1

Arguments

x

The first character vector of predicates.

y

The second character vector of predicates.

fsets

A valid instance of the fsets() class such that all values in x and y can be found in colnames(fsets)

vars

Deprecated parameter must be NULL.

specs

Deprecated parameter must be NULL.

Details

Let x_i and y_j represent some predicates of vectors x and y, respectively. Function assumes that each vector x and y does not contain two or more predicates with the same value of vars().

This function returns TRUE iff all of the following conditions hold:

Value

TRUE or FALSE (see description).

Author(s)

Michal Burda

See Also

perceive(), pbld(), fsets(), vars(), specs()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
    # prepare fsets object
    v <- c(rep('a', 3), rep('b', 3), rep('c', 3), rep('d', 3))
    s <- matrix(c(0,1,0, 0,0,0, 0,0,0, 0,0,0,
                  0,0,0, 0,0,0, 0,0,0, 0,0,0,
                  0,0,0, 0,0,0, 0,0,0, 0,0,0,

                  0,0,0, 0,1,0, 0,0,0, 0,0,0,
                  0,0,0, 0,0,0, 0,0,0, 0,0,0,
                  0,0,0, 0,0,0, 0,0,0, 0,0,0,

                  0,0,0, 0,0,0, 0,1,0, 0,0,0,
                  0,0,0, 0,0,0, 0,0,0, 0,0,0,
                  0,0,0, 0,0,0, 0,0,0, 0,0,0,

                  0,0,0, 0,0,0, 0,0,0, 0,1,0,
                  0,0,0, 0,0,0, 0,0,0, 0,0,0,
                  0,0,0, 0,0,0, 0,0,0, 0,0,0),
                byrow=TRUE,
                ncol=12)
    m <- matrix(0, nrow=1, ncol=12)
    colnames(m) <- paste(rep(c('VeSm', 'Sm', 'Bi'), times=4),
                         rep(c('a', 'b', 'c', 'd'), each=3),
                         sep='.')
    f <- fsets(m, v, s)


    # returns TRUE
    is.specific(c('VeSm.a', 'Bi.c'),
                c('VeSm.a', 'Bi.c'),
                f)

    # returns TRUE (x and y swapped return FALSE)
    is.specific(c('VeSm.a', 'Bi.c', 'Sm.d'),
                c('Sm.a', 'Bi.c', 'Sm.d'),
                f)

    # returns TRUE (x and y swapped return FALSE)
    is.specific(c('VeSm.a', 'Bi.c', 'Sm.d'),
                c('VeSm.a', 'Bi.c'),
                f)

    # returns TRUE (x and y swapped return FALSE)
    is.specific(c('VeSm.a', 'Bi.c', 'Sm.d'),
                character(),
                f)

    # returns FALSE
    is.specific(c('Sm.a'), c('Bi.c'), f)

    # returns FALSE
    is.specific(c('VeSm.a', 'Sm.c'),
                c('Sm.a', 'Bi.c'),
                f)

beerda/lfl documentation built on Oct. 17, 2020, 8:57 p.m.