View source: R/to_list_of_lists.R
to_list_of_lists | R Documentation |
Convert a named vector to a list of lists, to be used
by various functions in semptools
.
to_list_of_lists(input, name1 = NULL, name2 = NULL, name3 = NULL)
input |
A named vector |
name1 |
The name for the first element in the list-in-list.
Default is |
name2 |
The name for the second element in the list-in-list.
Defaultis |
name3 |
The name for the third element in the list-in-list.
Default is |
This function is not to be used by users, but to be used
internally by other functions of semptools
.
A list of lists.
x <- c("x1 ~~ x2" = -1, "x4 ~ x1" = 1)
to_list_of_lists(x, name1 = "from", name2 = "to", name3 = "new_curve")
#list(list(from = "x1", to = "x2", new_curve = -1),
# list(from = "x1", to = "x4", new_curve = 1))
y <- c(x1 = 0, x2 = 180, x3 = 140, x4 = 140)
to_list_of_lists(y, name1 = "node", name2 = "rotate")
#list(list(node = "x1", rotate = 0),
# list(node = "x2", rotate = 180),
# list(node = "x3", rotate = 140),
# list(node = "x4", rotate = 140))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.