prep_ucie_data: Check and reformat data for use with U-CIE functions

prep_ucie_dataR Documentation

Check and reformat data for use with U-CIE functions

Description

Takes a 2D or 3D matrix or data frame and returns a 3D matrix, checked for non-numeric values.

Usage

prep_ucie_data(dataset, rownames_col = NULL, check_3D = TRUE)

Arguments

dataset

A data frame or matrix of 2D or 3D values.

rownames_col

Optional: name of column to ignore during calculations.

check_3D

Optional: whether to check and force 3D output. Needed for reduced/cielab data, not needed for KNN data.

Details

The function does a number of processing steps to accept as many data formats as feasible:

  • Rownames in the first column of the matrix (as tested by unconvertability to numeric) or of the data frame are discarded.

  • Character matrices are converted to numeric.

  • Data frames are converted to matrices.

  • If rownames_col is given, that column is discarded as well.

  • 2D matrices or data frames are expanded to 3D by padding with 1's.


casblaauw/phosphocie documentation built on March 30, 2022, 8:28 p.m.