xlcRestore: Restoring objects from Excel files

View source: R/xlcRestore.R

xlcRestoreR Documentation

Restoring objects from Excel files

Description

Restores objects from Excel files that have been dumped using xlcDump.

Usage

xlcRestore(file = "dump.xlsx", pos = -1, overwrite = FALSE)

Arguments

file

Excel file from which to restore objects. This is normally a file that has been produced with xlcDump. Defaults to "dump.xlsx".

pos

Environment into which to restore objects. Can be specified either as an integer specifying the position in the search list, as a character naming an element in the search list or as an environment. Defaults to -1 which refers to the current environment.

overwrite

logical specifying if data objects should be overwritten if they already exist inside the environment pos.

Value

Named logical vector specifying if objects have been restored or not. An object may not be restored because there was an issue with reading the data from the worksheet or the object already existed in the environment pos (and overwrite = FALSE).

Author(s)

Martin Studer
Mirai Solutions GmbH https://mirai-solutions.ch

See Also

xlcDump, readNamedRegion, readWorksheet, readNamedRegionFromFile,
readWorksheetFromFile, xlcEdit

Examples

## Not run: 
require(datasets)
xlcDump(c("airquality", "CO2", "iris", "PlantGrowth", "swiss"),
        file = "myDump.xlsx", pos = "package:datasets")
xlcRestore(file = "myDump.xlsx", overwrite = TRUE)
# clean up
file.remove("myDump.xlsx")

## End(Not run)

XLConnect documentation built on Sept. 11, 2024, 8:04 p.m.