View source: R/read_ods_multsheets.R
read_ods_multsheets | R Documentation |
Read in multiple sheets in a .ods file.
read_ods_multsheets(path)
path |
Path to the .ods file to import. |
Currently, read_ods will only read one sheet at a time. read_ods_multsheets can handle multiple sheets in one .ods workbook, or, when used with list.files and lapply, multiple workbooks with multiple sheets.
The result is a named list of data frames, with the sheet name appended to the basename of the filename with the file extension removed.
A list of data frames–one data frame for each sheet.
Other readin functions:
list_sheetnames()
,
read_excelsheet()
,
read_header()
,
read_multsheets()
,
read_sheets()
## Not run:
write_ods(iris[iris$Species=="setosa",], "iris.ods", sheet = "setosa")
write_ods(iris[iris$Species=="versicolor",], "iris.ods",
sheet = "versicolor", append = TRUE)
write_ods(iris[iris$Species=="virginica",],
"iris.ods", sheet = "virginica", append = TRUE)
read_ods_multsheets("iris.ods")
# Read multiple files with multiple sheets
files <- list.files(data_folder, recursive = TRUE, pattern = "*.ods")
# Use lapply() with the result of list.files
lapply(files, read_ods_multsheets)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.