diff --git a/R/rp_xlsb.R b/R/rp_xlsb.R index 060f035..2ff8fa1 100644 --- a/R/rp_xlsb.R +++ b/R/rp_xlsb.R @@ -11,13 +11,13 @@ #' #' @examples #' path_xlsb <- system.file("extdata", "xltest.xlsb", package = "rpxl") -#' rp_xlsb(path_xlsb, sheet = 1, password = "1234") +#' rp_xlsb(path_xlsb, password = "1234", sheet = 1) #' #' @importFrom readxlsb read_xlsb #' @export rp_xlsb rp_xlsb <- function(path, - sheet = NULL, password, + sheet = NULL, range = NULL, col_names = TRUE, col_types = NULL, diff --git a/R/rp_xlsx.R b/R/rp_xlsx.R index c871061..81ba2fd 100644 --- a/R/rp_xlsx.R +++ b/R/rp_xlsx.R @@ -16,8 +16,8 @@ #' @importFrom readxl read_xlsx readxl_progress #' @export rp_xlsx rp_xlsx <- function(path, - sheet = NULL, password, + sheet = NULL, range = NULL, col_names = TRUE, col_types = NULL, diff --git a/README.Rmd b/README.Rmd index c75c02e..3e4e972 100644 --- a/README.Rmd +++ b/README.Rmd @@ -55,7 +55,6 @@ install_rpxl() ``` - ## Usage ```{r} @@ -78,7 +77,7 @@ sheet 1. ```{r} path_xlsb <- system.file("extdata", "xltest.xlsb", package = "rpxl") -rp_xlsb(path_xlsb, sheet = 1L, password = "1234") +rp_xlsb(path_xlsb, password = "1234", sheet = 1) ``` To decrypt a password-protected Excel file and save it under a different diff --git a/README.md b/README.md index 856c021..e7e0b95 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ specified (either with argument ‘sheet’ or ‘range’), whereas ``` r path_xlsb <- system.file("extdata", "xltest.xlsb", package = "rpxl") -rp_xlsb(path_xlsb, sheet = 1L, password = "1234") +rp_xlsb(path_xlsb, password = "1234", sheet = 1) ``` ## x ext protected diff --git a/man/rp_xlsb.Rd b/man/rp_xlsb.Rd index ef6ffa0..8ecbf99 100644 --- a/man/rp_xlsb.Rd +++ b/man/rp_xlsb.Rd @@ -6,8 +6,8 @@ \usage{ rp_xlsb( path, - sheet = NULL, password, + sheet = NULL, range = NULL, col_names = TRUE, col_types = NULL, @@ -20,10 +20,10 @@ rp_xlsb( \arguments{ \item{path}{Path to the xlsb workbook} -\item{sheet}{Name or index of the sheet to read. If the sheet name is specified as part of the range, this parameter is ignored} - \item{password}{Workbook password} +\item{sheet}{Name or index of the sheet to read. If the sheet name is specified as part of the range, this parameter is ignored} + \item{range}{A named range or a string representing an excel range (of the form Sheet!A1:D10) or a cellranger object} \item{col_names}{TRUE uses the first row as the column name, FALSE sets names to column.#, or a character vector} @@ -47,6 +47,6 @@ decrypt the password-protected workbook } \examples{ path_xlsb <- system.file("extdata", "xltest.xlsb", package = "rpxl") -rp_xlsb(path_xlsb, sheet = 1, password = "1234") +rp_xlsb(path_xlsb, password = "1234", sheet = 1) } diff --git a/man/rp_xlsx.Rd b/man/rp_xlsx.Rd index 8a3a3de..65e85c7 100644 --- a/man/rp_xlsx.Rd +++ b/man/rp_xlsx.Rd @@ -6,8 +6,8 @@ \usage{ rp_xlsx( path, - sheet = NULL, password, + sheet = NULL, range = NULL, col_names = TRUE, col_types = NULL, @@ -23,13 +23,13 @@ rp_xlsx( \arguments{ \item{path}{Path to the xls/xlsx file.} +\item{password}{Workbook password} + \item{sheet}{Sheet to read. Either a string (the name of a sheet), or an integer (the position of the sheet). Ignored if the sheet is specified via \code{range}. If neither argument specifies the sheet, defaults to the first sheet.} -\item{password}{Workbook password} - \item{range}{A cell range to read from, as described in \link[readxl]{cell-specification}. Includes typical Excel ranges like "B3:D87", possibly including the sheet name like "Budget!B2:G14", and more. Interpreted strictly, even if the