read_ods_multsheets.Rd
Read in multiple sheets in a .ods file.
read_ods_multsheets(path)
Path to the .ods file to import.
A list of data frames--one data frame for each sheet.
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.
Other readin functions:
list_sheetnames()
,
read_excelsheet()
,
read_header()
,
read_multsheets()
,
read_sheets()
if (FALSE) {
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)
}