loadDataSetsFromExcel: Load data sets from excel

View source: R/utilities-data-set.R

loadDataSetsFromExcelR Documentation

Load data sets from excel

Description

Load data sets from excel

Usage

loadDataSetsFromExcel(
  xlsFilePath,
  importerConfigurationOrPath,
  importAllSheets = FALSE
)

Arguments

xlsFilePath

Path to the excel file with the data

importerConfigurationOrPath

An object of type DataImporterConfiguration that is valid for the excel file or a path to a XML file with stored configuration

importAllSheets

If FALSE (default), only sheets specified in the importerConfiguration will be loaded. If TRUE, an attempt to load all sheets is performed. If any sheet does not comply with the configuration, an error is thrown.

Details

Load observed data from an excel file using an importer configuration

Value

A named set of DataSet objects. The naming is defined by the property importerConfiguration$namingPattern.

Examples


xlsFilePath <- system.file(
  "extdata", "CompiledDataSet.xlsx",
  package = "ospsuite"
)

importerConfiguration <- createImporterConfigurationForFile(xlsFilePath)
importerConfiguration$sheets <- "TestSheet_1"

dataSets <- loadDataSetsFromExcel(
  xlsFilePath = xlsFilePath,
  importerConfigurationOrPath = importerConfiguration,
  importAllSheets = FALSE
)

importerConfigurationFilePath <- system.file(
  "extdata", "dataImporterConfiguration.xml",
  package = "ospsuite"
)

dataSets <- loadDataSetsFromExcel(
  xlsFilePath = xlsFilePath,
  importerConfigurationOrPath = importerConfigurationFilePath,
  importAllSheets = FALSE
)

Open-Systems-Pharmacology/OSPSuite-R documentation built on May 8, 2024, 11:36 a.m.