The function as.vector()
returns a logical, numeric, or character
depending on the mode=
argument. If mode="any"
, the vector
has the mode that corresponds to the (internal) mode of the item
vector, that is, an item in class "integer.item" will become an integer
vector, an item in class "double.item" will become a double-precision
numeric vector, an item in class "character.item" will become a
character vector; since the internal mode of a "dateitem.item" or a
"Date.item" vector is numeric, a numeric vector will be returned.
The functions as.integer()
, as.numeric()
, as.character()
,
as.factor()
, and as.ordered()
return an integer, numeric,
or character vector, or an ordered or unordered factor, respectively.
When as.data.frame()
is applied to an survey item object, the
result is a single-column data frame, where the single column is a
numeric vector or character vector or factor depending on the
measurement
attribute of the item. In particular, if the
measurement
attribute equals "ratio"
or
"interval"
this column will be the result of as.vector()
,
if the measurement
attribute equals "ordinal"
this
column will be an ordered factor (see ordered
), and if
the measurement
attribute equals "nominal"
this
column will be an unordered factor (see factor
).
All these functions have in common that values declared as "missing" by
virtue of the value.filter
attribute will be turned into NA
.