Add centroids manually by picking X-ray counts of selected pixels in X-ray maps.

add_centers(
  centers,
  xmap,
  x = NULL,
  y = NULL,
  phase = if (is.null(x)) NULL else paste0("P", seq_along(x)),
  i = data.frame(x, y, phase),
  ...,
  saveas = "center_add.csv"
)

Arguments

centers

c-by-p matrix returned by find_centers() or by manually; c clusters and p features. Used to guess initial centers (or centroids) of clusters. A value returned by , typically data.frame or matrix, indicating initial guess centers (or centroids) or clusters. See find_centers().

xmap

An object generated by read_xmap()

x

A n-by-p training data matrix; n observations and p features. Used to train the classifier.

y

Integer vectors specifying x- and y-coordinates of pixels of mapping data. In other words, x- and y- corresponds to n-th column and row of a matrix.

phase

Selected ones are referenced to detect outliers. Default selects everything. Tidy selection is available. For example c(Si, Ti) selects them, and c(-Si, -Ti) selects everything except them.

i

A data frame with clumns x, y, and phase. i have priority to x, y, and phase.`

...

Ignored

saveas

File name to save result. FALSE if not saving.

See also