## Convert proportions to x-y co-ordinates
library(DImodels)
data(sim0)
sim0 <- sim0[1:16, ]
prop_to_tern_proj(data = sim0, prop = c("p1", "p2", "p3"))
# Change names of the x and y projections
prop_to_tern_proj(data = sim0, prop = c("p1", "p2", "p3"),
x = "x-proj", y = "y-proj")
## Convert x-y co-ordinates to proportions
library(DImodels)
data(sim0)
sim0 <- sim0[1:16, ]
proj_data <- prop_to_tern_proj(data = sim0, prop = c("p1", "p2", "p3"))
tern_to_prop_proj(data = proj_data, x = ".x", y = ".y")
# Change prop names
tern_to_prop_proj(data = proj_data, x = ".x", y = ".y",
prop = c("prop1", "prop2", "prop3"))
Run the code above in your browser using DataLab