The function ofactor()
is a convenience wrapper for
factor()
that orders the levels as they appear in the data if the
levels
argument is not specified.
ofactor(x = character(), ...)
x | A vector of data, usually taking a small number of distinct values. |
---|---|
... | Other arguments passed on to |
A factor. See base::factor()
for details.
Other deprecated functions: coalesce.na-deprecated
,
df_to_list-deprecated
,
hms.to.seconds-deprecated
,
kimisc-deprecated
,
list_to_df-deprecated
,
nc-deprecated
,
nlist-deprecated
,
sample.rows-deprecated
,
seconds.to.hms-deprecated
,
thisfile-deprecated
,
tll-deprecated
,
vswitch-deprecated
ofactor(3:1)#>#> [1] 3 2 1 #> Levels: 3 2 1ofactor(9:12, exclude=11)#> [1] 9 10 <NA> 12 #> Levels: 9 10 12identical(ofactor(3:1, levels=1:3), factor(3:1))#> [1] TRUE