ViewXL: ViewXL

Description Usage Arguments Value Examples

View source: R/ViewXL.R

Description

Views a data.frame or tbl_df object in excel, by saving it in R's temporary file directory (see: tempdir()). Works on Windows or Mac OS - not linux It will automatically open the excel sheet. User has the choice too of overriding the file location by setting the FilePath directly. It is recommended to save the output and use 'unlink' to delete afterwards. See ?ViewXL

Usage

1
ViewXL(DataFrame, FilePath, FileName, ViewTempFile = TRUE, mac = FALSE)

Arguments

DataFrame

This is the dataframe or tbl_df that will be displayed in excel

FilePath

If left blank, tempfile will be used. If specified, the excel files will be saved in specified location.

FileName

If specified to save csv file, this would be the name. If left blank and a FilePath has been specified, it would prompt the user to add a FileName.

ViewTempFile

True by default, if False it will not open the excel file, but merely save it. Only useful if provided with a FilePath.

mac

FALSE by default, set to TRUE if using a Mac, else the base::shell.exec will not work.

Value

File location in promt. Chosen data frame or tbl_df opened directly in excel.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
df <- data.frame( date = seq(
as.Date("2012-01-01"),
as.Date("2015-08-18"),"day"),
x = rnorm(1326, 10,2))
x <- ViewXL(df)
# After viewing, it is recommended to delete the temporary file created using:
unlink(x)

## End(Not run)

rmsfuns documentation built on July 8, 2020, 6:18 p.m.