Skip to contents

The final data set (annex statistics) are written into an XLSX file. This function allows to read one or multiple of these files into R.

Usage

annex_read_stats(file, raw = FALSE, validate = TRUE)

Arguments

file

character, name of the file(s) to be imported. Must end on XLSX (not case sensitive).

raw

logical. If FALSE a single data.frame will be returned, containing the statistics from all file(s). If set TRUE the raw information of the XLSX file(s) is returned (see Details).

validate

logical, if TRUE (default) the function first validates if the XLSX file is valid given the current version of annex.

Value

An object of class c("annex_xlsx_stats", "data.frame")

or a named list of data.frames. Depends argument raw, see section 'Details'.

Details

The XLSX files (if valid) contain a series of sheets, namely 'STATS', 'META-Study', 'META-Home', 'META-Room', and 'META-Variable' containing data information. This function has two different returns (depending on combine).

If raw = FALSE (default) only the 'STAT' sheet is imported. If there is more than one file the information from all files will be combined in one data.frame which is returned.

If raw = TRUE all the information from all sheets is read and stored in a named list. If there are multiple files, the content of the different sheets are combined. The return is a named list of length 5 containing a data.frame each. For usability purposes the sheet names will be modified, replacing "-" (XLSX) with "_" (names of list).

Author

Reto Stauffer