Description Usage Arguments Examples
Build standard conceptual scales
1 2 3 4 5 6 7 8 9 10 11 12 13 | make_scale_standard(objs, n, scale = "nominal", ...)
make_scale_nominal(objs)
make_scale_boolean(objs)
make_scale_ordinal(objs)
make_scale_revordinal(objs)
make_scale_interordinal(objs)
make_scale_biordinal(objs, cut = ceiling(length(objs)/2))
|
objs |
Vector (usually character or factor). |
n |
Positive integer. The number of objects in the scale. Ignored if
|
scale |
Character. Name of standard scale, e.g. "ordinal". Defaults to "nominal". |
... |
Additional arguments (listed below) passed from
|
cut |
Numeric. Integer between 0 and |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | titanic_data <- as.data.frame(Titanic)
# nominal scale
print(make_scale_nominal(objs = titanic_data$Class))
# ordinal scale
print(make_scale_ordinal(objs = titanic_data$Class))
# other scales
for (scale in c("boolean", "revordinal", "interordinal")) {
print(make_scale_standard(objs = titanic_data$Class, scale = scale))
}
# biordinal scale with custom cut value
print(make_scale_biordinal(objs = titanic_data$Class, cut = 3))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.