From b4906992c6300b39723c8f2b407b961edd413935 Mon Sep 17 00:00:00 2001 From: chainsawriot Date: Sun, 23 Jul 2023 17:14:57 +0200 Subject: [PATCH] Reduce documentation [no ci] --- R/list_ods_sheets.R | 62 +++--------- R/read_fods.R | 58 ------------ R/read_ods.R | 173 ++++++++++++++++++++-------------- man/get_num_sheets_in_fods.Rd | 31 ------ man/get_num_sheets_in_ods.Rd | 31 ------ man/list_fods_sheets.Rd | 31 ------ man/list_ods_sheets.Rd | 21 ++++- man/read_fods.Rd | 69 -------------- man/read_ods.Rd | 36 +++++-- 9 files changed, 159 insertions(+), 353 deletions(-) delete mode 100644 R/read_fods.R delete mode 100644 man/get_num_sheets_in_fods.Rd delete mode 100644 man/get_num_sheets_in_ods.Rd delete mode 100644 man/list_fods_sheets.Rd delete mode 100644 man/read_fods.Rd diff --git a/R/list_ods_sheets.R b/R/list_ods_sheets.R index 9cc72ad..bf2c798 100644 --- a/R/list_ods_sheets.R +++ b/R/list_ods_sheets.R @@ -1,15 +1,19 @@ -#' List all sheets in an ODS File +#' Get information in an (F)ODS File #' -#' List all sheets in an ods file. +#' `list_(f)ods_sheets` lists all sheets in an (f)ods file. #' -#' @param path Path to the ods file +#' @param path Path to the (f)ods file #' @param include_external_data A boolean value to show or hide sheets containing archived linked data (default false) -#' @return A character vector of sheet names. +#' @return For `list_(f)ods_sheets`, a character vector of sheet names; for `get_num_sheets_in_(f)ods`, the total number of sheets #' @author Peter Brohan , Chung-hong Chan , Gerrit-Jan Schutten #' @examples #' \dontrun{ #' # Get the list of names of sheets #' list_ods_sheets("starwars.ods") +#' list_fods_sheets("starwars.fods") +#' # Get the number of sheets +#' get_num_sheets_in_ods("starwars.ods") +#' get_num_sheets_in_fods("starwars.fods") #' } #' @seealso #' use \code{\link{read_ods}} to read the data @@ -18,64 +22,22 @@ list_ods_sheets <- function(path, include_external_data = FALSE) { return(get_sheet_names_(path, include_external_data)) } -#' Get the Number of Sheets in an ODS File -#' -#' Get the number of sheets in an ods file -#' -#' @param path path to the ods file -#' @param include_external_data A boolean value declaring if sheets holding archived linked data should be included -#' @return Number of sheets -#' @author Peter Brohan , Chung-hong Chan , Gerrit-Jan Schutten -#' @examples -#' \dontrun{ -#' # Get the number of sheets -#' get_num_sheets_in_ods("starwars.ods") -#' } -#' @seealso -#' use \code{\link{read_ods}} to read the data +#' @rdname list_ods_sheets #' @export get_num_sheets_in_ods <- function(path, include_external_data = FALSE) { sheets <- get_sheet_names_(path, include_external_data) return(length(sheets)) } -#' List all sheets in an FODS File -#' -#' List all sheets in an fods file. -#' -#' @param path Path to the fods file -#' @param include_external_data A boolean value to show or hide sheets containing archived linked data (default false) -#' @return A character vector of sheet names. -#' @author Peter Brohan , Chung-hong Chan , Gerrit-Jan Schutten -#' @examples -#' \dontrun{ -#' # Get the list of names of sheets -#' list_fods_sheets("starwars.fods") -#' } -#' @seealso -#' use \code{\link{read_fods}} to read the data +#' @rdname list_ods_sheets #' @export list_fods_sheets <- function(path, include_external_data = FALSE) { return(get_flat_sheet_names_(path, include_external_data)) } -#' Get the Number of Sheets in an FODS File -#' -#' Get the number of sheets in an fods file -#' -#' @param path path to the fods file -#' @param include_external_data A boolean value declaring if sheets holding archived linked data should be included -#' @return Number of sheets -#' @author Peter Brohan , Chung-hong Chan , Gerrit-Jan Schutten -#' @examples -#' \dontrun{ -#' # Get the number of sheets -#' get_num_sheets_in_fods("starwars.fods") -#' } -#' @seealso -#' use \code{\link{read_fods}} to read the data +#' @rdname list_ods_sheets #' @export get_num_sheets_in_fods <- function(path, include_external_data = FALSE) { sheets <- get_flat_sheet_names_(path, include_external_data) return(length(sheets)) -} \ No newline at end of file +} diff --git a/R/read_fods.R b/R/read_fods.R deleted file mode 100644 index 447cbb0..0000000 --- a/R/read_fods.R +++ /dev/null @@ -1,58 +0,0 @@ -#' Read Data From FODS File -#' -#' read_flat_ods is a function to read a single sheet from a flat ods file and return a data frame. -#' -#' @param path path to the fods file. -#' @param sheet sheet to read. Either a string (the sheet name), or an integer sheet number. The default is 1. -#' @param col_names logical, indicating whether the file contains the names of the variables as its first line. Default is TRUE. -#' @param col_types Either NULL to guess from the spreadsheet or refer to [readr::type_convert()] to specify cols specification. NA will return a data frame with all columns being "characters". -#' @param na Character vector of strings to use for missing values. By default read_ods converts blank cells to missing data. It can also be set to -#' NULL, so that empty cells are treated as NA. -#' @param skip the number of lines of the data file to skip before beginning to read data. If this parameter is larger than the total number of lines in the ods file, an empty data frame is returned. -#' @param formula_as_formula logical, a switch to display formulas as formulas "SUM(A1:A3)" or as the resulting value "3"... or "8".. . Default is FALSE. -#' @param range selection of rectangle using Excel-like cell range, such as \code{range = "D12:F15"} or \code{range = "R1C12:R6C15"}. Cell range processing is handled by the \code{\link[=cellranger]{cellranger}} package. -#' @param row_names logical, indicating whether the file contains the names of the rows as its first column. Default is FALSE. -#' @param strings_as_factors logical, if character columns to be converted to factors. Default is FALSE. -#' @param check_names logical, passed down to base::data.frame(). Default is FALSE. -#' @param verbose logical, if messages should be displayed. Default is FALSE. -#' @return A data frame (\code{data.frame}) containing a representation of data in the ods file. -#' @note For packaged ods files (.ods), use (\code{read_ods}) -#' @author Peter Brohan , Chung-hong Chan , Gerrit-Jan Schutten -#' @examples -#' \dontrun{ -#' # Read a file -#' read_fods("starwars.fods") -#' # Read a specific sheet, e.g. the 2nd sheet -#' read_fods("starwars.fods", sheet = 2) -#' # Read a specific range, e.g. A1:C11 -#' read_fods("starwars.fods", sheet = 2, range = "A1:C11") -#' } -#' @export -read_fods <- function(path, - sheet = 1, - col_names = TRUE, - col_types = NULL, - na = "", - skip = 0, - formula_as_formula = FALSE, - range = NULL, - row_names = FALSE, - strings_as_factors = FALSE, - check_names = FALSE, - verbose = FALSE -){ - ## Should use match.call but there's a weird bug if one of the variable names is 'file' - .read_ods(path, - sheet, - col_names, - col_types, - na, - skip, - formula_as_formula, - range, - row_names, - strings_as_factors, - check_names, - verbose, - flat = TRUE) -} \ No newline at end of file diff --git a/R/read_ods.R b/R/read_ods.R index 7d6efd2..f8cbcc9 100644 --- a/R/read_ods.R +++ b/R/read_ods.R @@ -1,5 +1,5 @@ -.change_df_with_col_row_header <- function(x, col_header, row_header){ - if((nrow(x) < 2 && col_header )|| (ncol(x) < 2 && row_header)){ +.change_df_with_col_row_header <- function(x, col_header, row_header) { + if((nrow(x) < 2 && col_header )|| (ncol(x) < 2 && row_header)) { warning("Cannot make column/row names if this would cause the dataframe to be empty.", call. = FALSE) return(x) } @@ -12,14 +12,11 @@ return(g) } - - - ## Based on readxl, although the implementation is different. ## If max row is -1, read to end of row. ## Row and column-numbers are 1-based .standardise_limits <- function(range, skip) { - if(is.null(range)){ + if(is.null(range)) { skip <- check_nonnegative_integer(skip, "skip") limits <- c( min_row = skip + 1, @@ -28,12 +25,12 @@ max_col = -1 ) } else { - if(skip != 0){ + if(skip != 0) { warning("Range and non-zero value for skip given. Defaulting to range.", call. = FALSE) } tryCatch({ limits <- cellranger::as.cell_limits(range) - }, error = function(e){ + }, error = function(e) { stop("Invalid `range`") }) limits <- c( @@ -101,69 +98,6 @@ } } - -#' Read Data From ODS File -#' -#' read_ods is a function to read a single sheet from an ods file and return a data frame. -#' -#' @param path path to the ods file. -#' @param sheet sheet to read. Either a string (the sheet name), or an integer sheet number. The default is 1. -#' @param col_names logical, indicating whether the file contains the names of the variables as its first line. Default is TRUE. -#' @param col_types Either NULL to guess from the spreadsheet or refer to [readr::type_convert()] to specify cols specification. NA will return a data frame with all columns being "characters". -#' @param na Character vector of strings to use for missing values. By default read_ods converts blank cells to missing data. It can also be set to -#' NULL, so that empty cells are treated as NA. -#' @param skip the number of lines of the data file to skip before beginning to read data. If this parameter is larger than the total number of lines in the ods file, an empty data frame is returned. -#' @param formula_as_formula logical, a switch to display formulas as formulas "SUM(A1:A3)" or as the resulting value "3"... or "8".. . Default is FALSE. -#' @param range selection of rectangle using Excel-like cell range, such as \code{range = "D12:F15"} or \code{range = "R1C12:R6C15"}. Cell range processing is handled by the \code{\link[=cellranger]{cellranger}} package. -#' @param row_names logical, indicating whether the file contains the names of the rows as its first column. Default is FALSE. -#' @param strings_as_factors logical, if character columns to be converted to factors. Default is FALSE. -#' @param check_names logical, passed down to base::data.frame(). Default is FALSE. -#' @param verbose logical, if messages should be displayed. Default is FALSE. -#' @return A data frame (\code{data.frame}) containing a representation of data in the ods file. -#' @note For flat ods files (.fods or .xml), use (\code{read_fods}). -#' @author Peter Brohan , Chung-hong Chan , Gerrit-Jan Schutten -#' @examples -#' \dontrun{ -#' # Read a file -#' read_ods("starwars.ods") -#' # Read a specific sheet, e.g. the 2nd sheet -#' read_ods("starwars.ods", sheet = 2) -#' # Read a specific range, e.g. A1:C11 -#' read_ods("starwars.ods", sheet = 2, range = "A1:C11") -#' } -#' @export -read_ods <- function(path, - sheet = 1, - col_names = TRUE, - col_types = NULL, - na = "", - skip = 0, - formula_as_formula = FALSE, - range = NULL, - row_names = FALSE, - strings_as_factors = FALSE, - check_names = FALSE, - verbose = FALSE - -) { - ## Should use match.call but there's a weird bug if one of the variable names is 'file' - .read_ods(path, - sheet, - col_names, - col_types, - na, - skip, - formula_as_formula, - range, - row_names, - strings_as_factors, - check_names, - verbose, - flat = FALSE) -} - - - .read_ods <- function(path, sheet = 1, col_names = TRUE, @@ -271,3 +205,100 @@ read_ods <- function(path, return(res) } + +#' Read Data From (F)ODS File +#' +#' read_ods is a function to read a single sheet from an (f)ods file and return a data frame. For flat ods files (.fods or .xml), +#' use (\code{read_fods}). +#' +#' @param path path to the (f)ods file. +#' @param sheet sheet to read. Either a string (the sheet name), or an integer sheet number. The default is 1. +#' @param col_names logical, indicating whether the file contains the names of the variables as its first line. Default is TRUE. +#' @param col_types Either NULL to guess from the spreadsheet or refer to [readr::type_convert()] to specify cols specification. NA will return a data frame with all columns being "characters". +#' @param na Character vector of strings to use for missing values. By default read_ods converts blank cells to missing data. It can also be set to +#' NULL, so that empty cells are treated as NA. +#' @param skip the number of lines of the data file to skip before beginning to read data. If this parameter is larger than the total number of lines in the ods file, an empty data frame is returned. +#' @param formula_as_formula logical, a switch to display formulas as formulas "SUM(A1:A3)" or as the resulting value "3"... or "8".. . Default is FALSE. +#' @param range selection of rectangle using Excel-like cell range, such as \code{range = "D12:F15"} or \code{range = "R1C12:R6C15"}. Cell range processing is handled by the \code{\link[=cellranger]{cellranger}} package. +#' @param row_names logical, indicating whether the file contains the names of the rows as its first column. Default is FALSE. +#' @param strings_as_factors logical, if character columns to be converted to factors. Default is FALSE. +#' @param check_names logical, passed down to base::data.frame(). Default is FALSE. +#' @param verbose logical, if messages should be displayed. Default is FALSE. +#' @return A data frame (\code{data.frame}) containing a representation of data in the (f)ods file. +#' @author Peter Brohan , Chung-hong Chan , Gerrit-Jan Schutten +#' @examples +#' \dontrun{ +#' # Read an ODS file +#' read_ods("starwars.ods") +#' # Read a specific sheet, e.g. the 2nd sheet +#' read_ods("starwars.ods", sheet = 2) +#' # Read a specific range, e.g. A1:C11 +#' read_ods("starwars.ods", sheet = 2, range = "A1:C11") +#' # Read an FODS file +#' read_fods("starwars.fods") +#' # Read a specific sheet, e.g. the 2nd sheet +#' read_fods("starwars.fods", sheet = 2) +#' # Read a specific range, e.g. A1:C11 +#' read_fods("starwars.fods", sheet = 2, range = "A1:C11") +#' } +#' @export +read_ods <- function(path, + sheet = 1, + col_names = TRUE, + col_types = NULL, + na = "", + skip = 0, + formula_as_formula = FALSE, + range = NULL, + row_names = FALSE, + strings_as_factors = FALSE, + check_names = FALSE, + verbose = FALSE + +) { + ## Should use match.call but there's a weird bug if one of the variable names is 'file' + .read_ods(path, + sheet, + col_names, + col_types, + na, + skip, + formula_as_formula, + range, + row_names, + strings_as_factors, + check_names, + verbose, + flat = FALSE) +} + +#' @rdname read_ods +#' @export +read_fods <- function(path, + sheet = 1, + col_names = TRUE, + col_types = NULL, + na = "", + skip = 0, + formula_as_formula = FALSE, + range = NULL, + row_names = FALSE, + strings_as_factors = FALSE, + check_names = FALSE, + verbose = FALSE +) { + ## Should use match.call but there's a weird bug if one of the variable names is 'file' + .read_ods(path, + sheet, + col_names, + col_types, + na, + skip, + formula_as_formula, + range, + row_names, + strings_as_factors, + check_names, + verbose, + flat = TRUE) +} diff --git a/man/get_num_sheets_in_fods.Rd b/man/get_num_sheets_in_fods.Rd deleted file mode 100644 index 3baee88..0000000 --- a/man/get_num_sheets_in_fods.Rd +++ /dev/null @@ -1,31 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/list_ods_sheets.R -\name{get_num_sheets_in_fods} -\alias{get_num_sheets_in_fods} -\title{Get the Number of Sheets in an FODS File} -\usage{ -get_num_sheets_in_fods(path, include_external_data = FALSE) -} -\arguments{ -\item{path}{path to the fods file} - -\item{include_external_data}{A boolean value declaring if sheets holding archived linked data should be included} -} -\value{ -Number of sheets -} -\description{ -Get the number of sheets in an fods file -} -\examples{ -\dontrun{ -# Get the number of sheets -get_num_sheets_in_fods("starwars.fods") -} -} -\seealso{ -use \code{\link{read_fods}} to read the data -} -\author{ -Peter Brohan \href{mailto:peter.brohan+cran@gmail.com}{peter.brohan+cran@gmail.com}, Chung-hong Chan \href{mailto:chainsawtiney@gmail.com}{chainsawtiney@gmail.com}, Gerrit-Jan Schutten \href{mailto:phonixor@gmail.com}{phonixor@gmail.com} -} diff --git a/man/get_num_sheets_in_ods.Rd b/man/get_num_sheets_in_ods.Rd deleted file mode 100644 index 07a4881..0000000 --- a/man/get_num_sheets_in_ods.Rd +++ /dev/null @@ -1,31 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/list_ods_sheets.R -\name{get_num_sheets_in_ods} -\alias{get_num_sheets_in_ods} -\title{Get the Number of Sheets in an ODS File} -\usage{ -get_num_sheets_in_ods(path, include_external_data = FALSE) -} -\arguments{ -\item{path}{path to the ods file} - -\item{include_external_data}{A boolean value declaring if sheets holding archived linked data should be included} -} -\value{ -Number of sheets -} -\description{ -Get the number of sheets in an ods file -} -\examples{ -\dontrun{ -# Get the number of sheets -get_num_sheets_in_ods("starwars.ods") -} -} -\seealso{ -use \code{\link{read_ods}} to read the data -} -\author{ -Peter Brohan \href{mailto:peter.brohan+cran@gmail.com}{peter.brohan+cran@gmail.com}, Chung-hong Chan \href{mailto:chainsawtiney@gmail.com}{chainsawtiney@gmail.com}, Gerrit-Jan Schutten \href{mailto:phonixor@gmail.com}{phonixor@gmail.com} -} diff --git a/man/list_fods_sheets.Rd b/man/list_fods_sheets.Rd deleted file mode 100644 index c0a7dc5..0000000 --- a/man/list_fods_sheets.Rd +++ /dev/null @@ -1,31 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/list_ods_sheets.R -\name{list_fods_sheets} -\alias{list_fods_sheets} -\title{List all sheets in an FODS File} -\usage{ -list_fods_sheets(path, include_external_data = FALSE) -} -\arguments{ -\item{path}{Path to the fods file} - -\item{include_external_data}{A boolean value to show or hide sheets containing archived linked data (default false)} -} -\value{ -A character vector of sheet names. -} -\description{ -List all sheets in an fods file. -} -\examples{ -\dontrun{ -# Get the list of names of sheets -list_fods_sheets("starwars.fods") -} -} -\seealso{ -use \code{\link{read_fods}} to read the data -} -\author{ -Peter Brohan \href{mailto:peter.brohan+cran@gmail.com}{peter.brohan+cran@gmail.com}, Chung-hong Chan \href{mailto:chainsawtiney@gmail.com}{chainsawtiney@gmail.com}, Gerrit-Jan Schutten \href{mailto:phonixor@gmail.com}{phonixor@gmail.com} -} diff --git a/man/list_ods_sheets.Rd b/man/list_ods_sheets.Rd index ef376af..3ed1b08 100644 --- a/man/list_ods_sheets.Rd +++ b/man/list_ods_sheets.Rd @@ -2,25 +2,38 @@ % Please edit documentation in R/list_ods_sheets.R \name{list_ods_sheets} \alias{list_ods_sheets} -\title{List all sheets in an ODS File} +\alias{get_num_sheets_in_ods} +\alias{list_fods_sheets} +\alias{get_num_sheets_in_fods} +\title{Get information in an (F)ODS File} \usage{ list_ods_sheets(path, include_external_data = FALSE) + +get_num_sheets_in_ods(path, include_external_data = FALSE) + +list_fods_sheets(path, include_external_data = FALSE) + +get_num_sheets_in_fods(path, include_external_data = FALSE) } \arguments{ -\item{path}{Path to the ods file} +\item{path}{Path to the (f)ods file} \item{include_external_data}{A boolean value to show or hide sheets containing archived linked data (default false)} } \value{ -A character vector of sheet names. +For \verb{list_(f)ods_sheets}, a character vector of sheet names; for \verb{get_num_sheets_in_(f)ods}, the total number of sheets } \description{ -List all sheets in an ods file. +\verb{list_(f)ods_sheets} lists all sheets in an (f)ods file. } \examples{ \dontrun{ # Get the list of names of sheets list_ods_sheets("starwars.ods") +list_fods_sheets("starwars.fods") +# Get the number of sheets +get_num_sheets_in_ods("starwars.ods") +get_num_sheets_in_fods("starwars.fods") } } \seealso{ diff --git a/man/read_fods.Rd b/man/read_fods.Rd deleted file mode 100644 index 024a928..0000000 --- a/man/read_fods.Rd +++ /dev/null @@ -1,69 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/read_fods.R -\name{read_fods} -\alias{read_fods} -\title{Read Data From FODS File} -\usage{ -read_fods( - path, - sheet = 1, - col_names = TRUE, - col_types = NULL, - na = "", - skip = 0, - formula_as_formula = FALSE, - range = NULL, - row_names = FALSE, - strings_as_factors = FALSE, - check_names = FALSE, - verbose = FALSE -) -} -\arguments{ -\item{path}{path to the fods file.} - -\item{sheet}{sheet to read. Either a string (the sheet name), or an integer sheet number. The default is 1.} - -\item{col_names}{logical, indicating whether the file contains the names of the variables as its first line. Default is TRUE.} - -\item{col_types}{Either NULL to guess from the spreadsheet or refer to \code{\link[readr:type_convert]{readr::type_convert()}} to specify cols specification. NA will return a data frame with all columns being "characters".} - -\item{na}{Character vector of strings to use for missing values. By default read_ods converts blank cells to missing data. It can also be set to -NULL, so that empty cells are treated as NA.} - -\item{skip}{the number of lines of the data file to skip before beginning to read data. If this parameter is larger than the total number of lines in the ods file, an empty data frame is returned.} - -\item{formula_as_formula}{logical, a switch to display formulas as formulas "SUM(A1:A3)" or as the resulting value "3"... or "8".. . Default is FALSE.} - -\item{range}{selection of rectangle using Excel-like cell range, such as \code{range = "D12:F15"} or \code{range = "R1C12:R6C15"}. Cell range processing is handled by the \code{\link[=cellranger]{cellranger}} package.} - -\item{row_names}{logical, indicating whether the file contains the names of the rows as its first column. Default is FALSE.} - -\item{strings_as_factors}{logical, if character columns to be converted to factors. Default is FALSE.} - -\item{check_names}{logical, passed down to base::data.frame(). Default is FALSE.} - -\item{verbose}{logical, if messages should be displayed. Default is FALSE.} -} -\value{ -A data frame (\code{data.frame}) containing a representation of data in the ods file. -} -\description{ -read_flat_ods is a function to read a single sheet from a flat ods file and return a data frame. -} -\note{ -For packaged ods files (.ods), use (\code{read_ods}) -} -\examples{ -\dontrun{ -# Read a file -read_fods("starwars.fods") -# Read a specific sheet, e.g. the 2nd sheet -read_fods("starwars.fods", sheet = 2) -# Read a specific range, e.g. A1:C11 -read_fods("starwars.fods", sheet = 2, range = "A1:C11") -} -} -\author{ -Peter Brohan \href{mailto:peter.brohan+cran@gmail.com}{peter.brohan+cran@gmail.com}, Chung-hong Chan \href{mailto:chainsawtiney@gmail.com}{chainsawtiney@gmail.com}, Gerrit-Jan Schutten \href{mailto:phonixor@gmail.com}{phonixor@gmail.com} -} diff --git a/man/read_ods.Rd b/man/read_ods.Rd index 08558ef..7617725 100644 --- a/man/read_ods.Rd +++ b/man/read_ods.Rd @@ -2,7 +2,8 @@ % Please edit documentation in R/read_ods.R \name{read_ods} \alias{read_ods} -\title{Read Data From ODS File} +\alias{read_fods} +\title{Read Data From (F)ODS File} \usage{ read_ods( path, @@ -18,9 +19,24 @@ read_ods( check_names = FALSE, verbose = FALSE ) + +read_fods( + path, + sheet = 1, + col_names = TRUE, + col_types = NULL, + na = "", + skip = 0, + formula_as_formula = FALSE, + range = NULL, + row_names = FALSE, + strings_as_factors = FALSE, + check_names = FALSE, + verbose = FALSE +) } \arguments{ -\item{path}{path to the ods file.} +\item{path}{path to the (f)ods file.} \item{sheet}{sheet to read. Either a string (the sheet name), or an integer sheet number. The default is 1.} @@ -46,22 +62,26 @@ NULL, so that empty cells are treated as NA.} \item{verbose}{logical, if messages should be displayed. Default is FALSE.} } \value{ -A data frame (\code{data.frame}) containing a representation of data in the ods file. +A data frame (\code{data.frame}) containing a representation of data in the (f)ods file. } \description{ -read_ods is a function to read a single sheet from an ods file and return a data frame. -} -\note{ -For flat ods files (.fods or .xml), use (\code{read_fods}). +read_ods is a function to read a single sheet from an (f)ods file and return a data frame. For flat ods files (.fods or .xml), +use (\code{read_fods}). } \examples{ \dontrun{ -# Read a file +# Read an ODS file read_ods("starwars.ods") # Read a specific sheet, e.g. the 2nd sheet read_ods("starwars.ods", sheet = 2) # Read a specific range, e.g. A1:C11 read_ods("starwars.ods", sheet = 2, range = "A1:C11") +# Read an FODS file +read_fods("starwars.fods") +# Read a specific sheet, e.g. the 2nd sheet +read_fods("starwars.fods", sheet = 2) +# Read a specific range, e.g. A1:C11 +read_fods("starwars.fods", sheet = 2, range = "A1:C11") } } \author{