DescTools (version 0.99.8.1)

XLView: Use Excel as Viewer for a Data.Frame

Description

XLView can be used to view and edit a data.frame directly in Excel, resp. to create a new data.frame in Excel.

Usage

XLView(x, col.names = TRUE, row.names = TRUE)

Arguments

x
is a data.frame to be transferred to Excel. If data is missing a new file will be created.
row.names
either a logical value indicating whether the row names of x are to be written along with x, or a character vector of row names to be written.
col.names
either a logical value indicating whether the column names of x are to be written along with x, or a character vector of column names to be written. See the section on 'CSV files' write.table fo

Value

  • the name/path of the temporary file edited in Excel.

Details

The data.frame will be exported in CSV format and then imported in Excel. Take care: Changes to the data made in Excel will NOT automatically be updated in the original data.frame. The user will have to read the csv-file into R again. See examples how to get this done.

See Also

GetNewXL, XLGetRange, XLGetWorkbook

Examples

Run this code
# Windows-specific example
XLView(d.diamonds)

# edit an existing data.frame in Excel, make changes and save there, return the filename
fn <- XLView(d.diamonds)
# read the changed file and store in new data.frame
d.frm <- read.table(fn, header=TRUE, quote="", sep=";")

# Create a new file, edit it in Excel...
fn <- XLView()
# ... and read it into a data.frame when in R again
d.set <- read.table(fn, header=TRUE, quote="", sep=";")

Run the code above in your browser using DataCamp Workspace