| is.specific | R Documentation |
x of predicates is more specific (or equal)
than y with respect to vars and specs.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.
is.specific(x, y, fsets, vars = NULL, specs = NULL)
x |
The first character vector of predicates. |
y |
The second character vector of predicates. |
fsets |
A valid instance of the |
vars |
Deprecated parameter must be |
specs |
Deprecated parameter must be |
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:
for any y_j there exists x_i such that vars[y_j] = vars[x_i];
for any x_i there either does not exist y_j such that
vars[x_i] = vars[y_j], or x_i = y_j, or specs[x_i, y_j] = 1.
TRUE or FALSE (see description).
Michal Burda
perceive(), pbld(), fsets(), vars(), specs()
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.