load.data: Loading data of various formats

View source: R/load.data.r

load.dataR Documentation

Loading data of various formats

Description

Read data for an analysis from a variety of external typical file types, and assign them

Usage

load.data(
  xptFiles,
  xlsFiles,
  csvFiles,
  tabFiles,
  dir = "../project input/client data/data",
  xlsNames,
  xptNames,
  csvNames,
  tabNames,
  perl = "C:/Perl64/bin/perl.exe",
  xlsSheets,
  doScan = TRUE,
  target.env = parent.frame()
)

Arguments

xptFiles

vector of SAS transport (XPT) filenames

xlsFiles

vector of Microsoft Excel (XLS, XLSX) filenames

csvFiles

vector of comma-delimited (CSV) filenames

tabFiles

vector of tab-delimited (ASCII) filenames

dir

directory where the files reside

xlsNames

vector of object names for each Microsoft Excel (XLS, XLSX) file, in the same order.

xptNames

vector of object names for each SAS transport (XPT) file, in the same order.

csvNames

vector of object names for each comma-delimited (CSV) file, in the same order

tabNames

vector of object names for each tab-delimited (ASCII) file, in the same order

perl

directory where the perl executable resides

xlsSheets

a numeric vector of length(xlsFiles) defining which sheet in the workbook needs to be read. If you do not specify this, by default the first sheet of each workbook will be read.

doScan

logical

target.env

environment The environment into which the data files will be loaded and attached.

Value

Placeholder for return description

Examples

## Not run: 
load.data(xlsFiles = "ExampleInput.xlsx",
xlsNames = "XLinput1",
xlsSheets = 1, doScan = FALSE)
head(XLinput1)
head(iXLinput1)
load.data(xlsFiles = "ExampleInput.xlsx",
          xlsNames = "XLinput2",
          xlsSheets = 2,            # NOTE We can specify which worksheet (tab) of the Excel file
          doScan = FALSE)
head(iXLinput2)
load.data(csvFiles = c("ExampleInput2.csv","ExampleInput3.csv"),
          csvNames = c("CSVinput1", "CSVinput2"),
          doScan = FALSE)
head(CSVinput1)
load.data() # loading JUST doing automatic search for files ("scan")

## End(Not run)

qPharmetra/qpToolkit documentation built on May 24, 2023, 8:52 a.m.