This function takes a data.frame, moves it to unit simplex representation and then projects the points onto a lower representation space (using A).

to_lower_simplex(df, A = NULL)

Arguments

df

an n x p data.frame, all scalar columns

A

default is NULL, if so, we create A from simplex_project_mat

Value

updated dat.frame (n x k), where k should be p-1, but that's assuming A is made from simplex_project_mat

Examples

center <- data.frame(x = 1, y = 1, z = 1) to_lower_simplex(center) # 0,0 # center
#> V1 V2 #> 1 0 0
side <- data.frame(x = 1, y = 0, z =0) to_lower_simplex(side) #(1,0)
#> V1 V2 #> 1 1 0