The function characterNames()
is applicable on
all tables with a character table
(that are of the class QDHasCharacter
). It can be used to reformat the character
names. The function FUN
is applied to the character name entries within
the QDDrama
object. The factor levels in the character column of x
are replaced by
the result values of FUN
.
characterNames(x, drama, FUN = stringr::str_to_title, sort = 0, ...)
x | The object in which we want to transform names, needs to inherit the type |
---|---|
drama | The QDDrama object with all the information. |
FUN | A function applied to the strings.
Defaults to |
sort | Numeric. If set to a non-zero value, the resulting data.frame will be sorted
alphabetically
according to the drama and character name. If the value is above 0, the
sorting will be ascending, if set to a negative value, the sorting is
descending. If sort is set to 0 (the default), the order is unchanged.
The ordering can also be specified explicitly, by passing an integer vector
with as many elements as |
... | All other arguments are ignored. |
The function returns x
, but with modified character
names.
str_to_title