as_integer {wakefield} | R Documentation |
Convert a Factor Data Frame to Integer
Description
Converts a data.frame
of factor
s to
integers.
Usage
as_integer(x, cols = NULL, fun = as.integer)
Arguments
x |
A |
cols |
Numeric indices of the columns to incude (use |
fun |
An |
Value
Returns a data.frame
equal to the
class
of x
with integer columns rather than factor.
See Also
Examples
as_integer(r_series(likert_7, 5, 10))
as_integer(r_series(likert_7, 5, 10), cols = c(2, 4))
library(dplyr)
r_data_frame(n=100,
age,
political,
sex,
grade
) %>%
as_integer(2:3)
[Package wakefield version 0.3.6 Index]