Description Usage Arguments Value Examples
Expand variables in a data frame via logical conceptual scaling
1 | scale_by_predicate(data, predicates)
|
data |
Data frame. |
predicates |
A logical expression involving variables in |
A binary numeric matrix (formal context) of nrow(data)
rows
and 1 column, whose entries are the truth values of predicate
applied to the rows of data
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # logical expressions involving single variables
scale_by_predicate(mtcars, cyl == 8)
scale_by_predicate(mtcars, mpg > 20)
# logical expressions involving multiple variables
scale_by_predicate(mtcars, cyl > 4 & wt < 3)
# multiple logical expressions
scale_by_predicate(mtcars, list(cyl > 4, wt < 3, mpg > 20))
# singleton list
scale_by_predicate(mtcars, list(cyl == 6))
# list with some predicates named
scale_by_predicate(mtcars, list(`4-cyl` = cyl == 4,
wt > 2,
goodMPG = mpg > 20))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.