Description Usage Arguments Value References See Also Examples
The measurement level of a "item"
object, which is one of "nominal", "ordinal", "interval", "ratio",
determines what happens to it, if it or the data.set
containing it is coerced into a data.frame
.
If the level of measurement level is "nominal", the it will be
converted into an (unordered) factor, if the level of measurement is "ordinal",
the item will be converted into an ordered vector. If the measurement
is "interval" or "ratio", the item will be converted into a numerical vector.
1 2 3 4 5 6 7 8 | ## S4 method for signature 'item'
measurement(x)
## S4 replacement method for signature 'item'
measurement(x) <- value
is.nominal(x)
is.ordinal(x)
is.interval(x)
is.ratio(x)
|
x |
an object, usually of class |
value |
a character string; either "nominal", "ordinal", "interval", or "ratio". |
measurement(x)
returns a character string.
is.nominal
, is.ordinal
, is.interval
, is.ratio
return a logical value.
Stevens, Stanley S. 1946. "On the theory of scales of measurement." Science 103: 677-680.
1 2 3 4 5 6 7 8 9 10 11 | answer <- sample(c(1,2,3,8,9),size=30,replace=TRUE)
labels(answer) <- c(Conservatives = 1,
Labour = 2,
"Liberal Democrats" = 3,
"Don't know" = 8,
"Answer refused" = 9
)
missing.values(answer) <- c(8,9)
as.data.frame(answer)[[1]]
measurement(answer) <- "interval"
as.data.frame(answer)[[1]]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.