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))
Run the code above in your browser using DataLab