
Extract the property names from a given data.frame
Source: R/extract_property_names.R
extract_property_names.RdThis function aims to extract the column names of properties from x. A property
in this context is a response vector of numerical values that then later can
be calibrated for predictions (such as with calibrate).
Arguments
- x
a
data.frame, as normally obtained byproximate_read_data,read_spc,proxiscout_read_data, or some other data parsing function.
Value
A character vector, containing only the names of numerical properties. If no property names were identified, return a character vector of length 0.
Details
Depending on the class of x, the names of the properties are identified
differently. For all cases, only columns which contain numerical values
(including NA) are considered as potential properties.
If x is of class proximate_data, the property names are identified as follows:
Located between columns "Reference" and "Begin".
Not named according to any of the following names: "ROW", "Check", "Date", "SNR", "SRN", "ID", "Barcode", "Note", "Result", "Reference", "Begin", "End", "Recipe", "Composition", "Images", "spc".
Contain only numerical values (including NA).
If x is of class proxiscout_data, property names are identified as columns that
contain only numerical values (including NA) and are not matched by any of the
following, case-insensitive regex (each wrapped by ^ and $):
idsample[_. ]?namecaptured[_. ]?atdevice[_. ]?idcreated[_. ]?(by|at)on[_. ]?behalf[_. ]?oflot[_. ]?namescanner([_. ]?id)?original[_. ]?valuedisplay[_. ]?valuenotelocationsupplierdevicespcpredictions
If x is of neither class, all columns with numerical values are considered to be properties