transformations | R Documentation |
Mutate_faces and transfrom_faces are metafunctions that allow to create new variables in all the dataframes of a face object. Mutate_faces adds a new variables by writing their name and a formula (see examples). It is the openfacer equivalent of dplyr::mutate. Transform_faces use functions that take as input a whole face dataframe.
mutate_faces(faces, ...)
transform_faces(faces, var, fun)
faces |
A "faces" object. |
... |
only in mutate_faces. Pairs of expression inluding a name and the formula for caluclating the value. |
var |
The name, as a string, of the new variable created (transform_faces). |
fun |
The name of the function to use (transform_faces) |
#Create a "smiles" variable
#' mutate_faces(test_faces, smile = ifelse(AU06_c == 1 & AU12_c == 1, 1, 0))
#Create a mei variable, select it and summarise
test_faces %>%
transform_faces("mei", mei) %>%
select_faces(mei) %>%
tidy_face()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.