readOds: Read the sheets in an Open Office workbook

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

This function is a “quick” implementation of reading all of the spreadsheets within an Open Office workbook. It reads each sheet into a data frame and returns these as a list.

Usage

1
2
3
read.ods(file, header = TRUE, simplify = TRUE,
          doc = xmlParse(zipArchive(file)[["content.xml"]]),
           stringsAsFactors = TRUE)

Arguments

file

the name of the .ods file

header

a logical value indicating whether the first row is a

simplify

a logical value which is intended to allow the caller retrieve a data.frame object rather than a list containing one data.frame when there is only one worksheet in the workbook.

doc

the parsed XML document containing the content of the work book. This is a parameter to allow caller who are processing other aspects of the workbook to pass the already parsed XML document to this function, perhaps having modified it.

stringsAsFactors

a logical value controlling whether variables in the result data frame are converted to a factors if they are strings. This is passed to as.data.frame.

Details

This uses the Rcompression package to access the files within the archive and then

Value

If simplify is TRUE and the workbook contains a single work sheet, a data frame is returned; otherwise, a list in which each element is a data frame is returned.

Author(s)

Duncan Temple Lang

References

~put references to the literature/web site here ~

See Also

xmlParse, getNodeSet

Examples

1
2
  f = system.file("sampleData", "Spreadsheet.ods", package = "ROpenOffice")
  read.ods(f, FALSE)

duncantl/ROpenOffice documentation built on May 15, 2019, 5:33 p.m.