.jpinfect_read_excel {jpinfect} | R Documentation |
Process a Single Excel File
Description
This internal function processes a single Excel file containing case reports. The function dynamically adapts to the structure of the file based on its type and year.
Usage
.jpinfect_read_excel(file_path, year = NULL, sheet_range = NULL)
Arguments
file_path |
A character string specifying the path to the Excel file. |
year |
An optional integer specifying the year of the data. If NULL, the year is inferred from the file name. |
sheet_range |
A vector of integers specifying the sheet range to process. If NULL, it is inferred based on the year. |
Details
The function reads data from the specified sheet range using read_excel
. It handles specific data formatting
for "sex"
and "place"
datasets based on file patterns and column structures.
Supported file patterns:
"sex"
Files with names containing
"11.xls"
or"01_1.xls"
."place"
Files with names containing
"02_1.xls"
.
Value
A data frame containing processed case reports from the specified file.