From 1282a9c41a385656c4641c2cab3780b9c9b2a9ac Mon Sep 17 00:00:00 2001 From: chainsawriot Date: Fri, 10 Jul 2020 11:33:29 +0200 Subject: [PATCH] retain ods_sheets for now, because readtext needs that --- NAMESPACE | 1 + R/readODS.R | 7 +++++++ man/list_ods_sheets.Rd | 3 +++ tests/testthat/test_legacy.R | 5 +++++ 4 files changed, 16 insertions(+) diff --git a/NAMESPACE b/NAMESPACE index e4c821d..1621b79 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -3,6 +3,7 @@ export(getNrOfSheetsInODS) export(get_num_sheets_in_ods) export(list_ods_sheets) +export(ods_sheets) export(read.ods) export(read_ods) export(write_ods) diff --git a/R/readODS.R b/R/readODS.R index c87dcab..854a5f8 100644 --- a/R/readODS.R +++ b/R/readODS.R @@ -309,3 +309,10 @@ list_ods_sheets <- function(path) { res <- .parse_ods_to_sheets(path) return(sapply(res[[1]], function(x) xml2::xml_attr(x, "table:name", res[[2]]))) } + +#' @rdname list_ods_sheets +#' @export +ods_sheets <- function(path) { + warning("ods_sheets will be depreciated in the next version. Use list_ods_sheets instead.") + list_ods_sheets(path) +} diff --git a/man/list_ods_sheets.Rd b/man/list_ods_sheets.Rd index 95f8a3d..f487509 100644 --- a/man/list_ods_sheets.Rd +++ b/man/list_ods_sheets.Rd @@ -2,9 +2,12 @@ % Please edit documentation in R/readODS.R \name{list_ods_sheets} \alias{list_ods_sheets} +\alias{ods_sheets} \title{List all sheets in an ods file.} \usage{ list_ods_sheets(path) + +ods_sheets(path) } \arguments{ \item{path}{Path to the ods file} diff --git a/tests/testthat/test_legacy.R b/tests/testthat/test_legacy.R index 5eece9f..52f4d43 100644 --- a/tests/testthat/test_legacy.R +++ b/tests/testthat/test_legacy.R @@ -12,6 +12,11 @@ s_read.ods <- function(...) { }) } +test_that("ods_sheets", { + file="../testdata/test.ods" + expect_warning(ods_sheets(file)) +}) + test_that("getNrOfSheetsInODS", { file="../testdata/test.ods" expect_warning(getNrOfSheetsInODS(file))