Skip to contents

Inverse of write_technology_xlsx(). Reads the block-structured worksheets produced by that function and rebuilds class-technology objects, coercing each mini-table's columns back to the types declared by the class.

Usage

read_technology_xlsx(path, sheet = NULL, as_repository = FALSE)

Arguments

path

Path to the .xlsx file.

sheet

Optional sheet name or index. If a single sheet is given, a single technology object is returned; otherwise all sheets are read.

as_repository

Logical; if TRUE, wrap the result in a repository.

Value

A technology object (single sheet), a named list of technology objects, or a repository (when as_repository = TRUE).

Examples

tech <- topia$modules$electricity$R3$ECOA
f <- tempfile(fileext = ".xlsx")
write_technology_xlsx(tech, f)

# a named list of the technologies found in the workbook
back <- read_technology_xlsx(f)
names(back)
#> [1] "ECOA"
identical(back[[1]]@name, tech@name)
#> [1] TRUE