look_ncols_excel: Look up the number of columns in an excel sheet

View source: R/files.R

look_ncols_excelR Documentation

Look up the number of columns in an excel sheet

Description

look_ncols_excel is a function that reads in the first two lines of an excel sheet and returns the number of columns. It is used as a helper function to set the correct column types when importing all the time series data downloaded from Lipper. The reason for this is that the first column in excel output from Lipper contains the row numbers, but when the sheet has no data, this first column will not be detected by read_excel. Therefore the column types specified will vary depending on the output from Lipper.

Usage

look_ncols_excel(excel_file = NULL, sheet_num = NULL)

Arguments

excel_file

Complete file name (path) to the excel file

sheet_num

Integer value - the sheet number to read to R

Details

Robust function: FALSE

Value

Returns the number of columns detected by read_excel


AndreSjuve/dretools documentation built on Dec. 4, 2024, 3:12 a.m.