Identify the row in a CSV file that matches the header based on required column names.
Usage
find_header(user_file, required_user_column_names, valid_header_rows = 1:2)
Arguments
- user_file
A data frame representing the CSV file.
- required_user_column_names
A character vector of required column names.
A numeric vector of row numbers to consider as potential header rows.
By default, it considers the first two rows.
Value
An integer representing the row number where the header was found, or NULL if not found.
Examples
if (FALSE) { # \dontrun{
user_data <- read.csv("path_to_user_file.csv", header = FALSE)
find_header(user_data, c("Name", "Age"))
} # }