R/ib_reader.R

#' @title ib_reader
#'
#' @description A function to read installbase file obtained from Information Anywhere.
#' Must be a .xlsx file.
#'
#' @param filepath Path to installbase file obtained from Information Anywhere.
#' @param sheetindex Sheet number where total installbase is contained. Defaults to sheet 2
#' @param datastart Row index where data starts. Defaults to 10.
#'
#' @return Returns installbase report as dataframe.
#'
#' @export

ib_reader <- function(
  filepath,
  sheetindex = 2,
  datastart = 10
) {

  df <- openxlsx::read.xlsx(
    xlsxFile = filepath,
    sheet = sheetindex,
    startRow = datastart
  )

  return(df)
}
kimjam/srms documentation built on May 20, 2019, 10:21 p.m.