View source: R/check_Bmatrix.R

check_Bmatrix | R Documentation |

Function which checks B matrix of Archetypal Analysis Y ~ A B Y in order to find the used rows for creating each archetype and the relevant used weights.

```
check_Bmatrix(B, chvertices = NULL, verbose = TRUE)
```

`B` |
The |

`chvertices` |
The vector of rows which represent the Convex Hull of data frame |

`verbose` |
If set to TRUE, then results are printed out. |

A list with members:

used_rows, a list with used rows for creating each archetype

used_weights, a list with the relevant weights that have been used

leading_rows, the rows for each archetype with greatest weight

leading_weights, the weights of leading rows

used_on_convexhull, the portion of used rows which lie on Convex Hull (if given)

`archetypal`

, `check_Bmatrix`

, `find_closer_points`

& `study_AAconvergence`

```
{
# Load data "wd2"
data("wd2")
df = wd2
# Run AA:
aa = archetypal(df = df, kappas = 3, verbose = FALSE)
# Check B matrix:
B = aa$B
yy = check_Bmatrix(B, verbose = TRUE)
yy$used_rows
yy$used_weights
yy$leading_rows
yy$leading_weights
# Check if used rows lie on ConvexHull
ch = chull(df)
yy = check_Bmatrix(B, chvertices = ch, verbose = FALSE)
yy$used_on_convexhull
#
}
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.