Skip to contents

This function takes a dataframe and identifies a rectangular or quadratic area containing numeric data, starting from the first occurrence of a 6x6 block of numeric values. It then extracts this area into a matrix, ensuring that each row contains only numeric values. Rows with any NA values are removed from the resulting matrix.

Usage

extract_data(data, feature_name_columns = NA, user_prompt = TRUE)

Arguments

data

A dataframe loaded from a tabular file, potentially containing a rectangular or quadratic area with numeric data amidst other values.

feature_name_columns

(Optional) A character vector, specifying the columns of the dataframe data, that should be used to construct the feature names. If ommited, the feature names are just numbers (stored as characters) starting from 1 (1, 2, 3, etc.)

user_prompt

Boolean specifying whether the user prompt about the correct format of the input data should be shown.

Value

A numeric matrix with row headers and appropriate column names.