Skip to content

Commit

Permalink
better documentation for local parameter of writing functions
Browse files Browse the repository at this point in the history
  • Loading branch information
idmn committed Apr 28, 2024
1 parent 904e827 commit cc14908
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 12 deletions.
19 changes: 19 additions & 0 deletions R/doc.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,22 @@
#'
#' @keywords internal
doc_file <- function(file) {}



#' @title Package-wide description of `local` parameter
#' @description A dummy function to be referred by `@inheritParams` for a
#' parameter documentation.
#'
#' @param local Logical, defaulting to `FALSE`. If `TRUE`, the function will
#' also create a local copy of the file at the specified path. Note that some
#' writing functions might not overwrite existing files unless explicitly
#' allowed. Typically, such functions have a parameter (often named
#' `overwrite`) to control this behavior. Check the documentation of the
#' writing function used to determine the exact parameter name and pass it
#' through the `...` argument if necessary. Alternatively, you can define an
#' anonymous function for `fun` that calls a writing function with the
#' overwriting option enabled.
#'
#' @keywords internal
doc_local <- function(local) {}
3 changes: 1 addition & 2 deletions R/drive_transfer.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,12 @@ cloud_drive_download <- function(file, root = NULL) {
#'
#' @inheritParams doc_file
#' @inheritParams cloud_drive_ls
#' @inheritParams doc_local
#'
#' @param x An R object to be written to Google Drive.
#' @param fun A custom writing function. If `NULL` (default), the appropriate
#' writing function will be inferred based on the file's extension.
#' @param ... Additional arguments to pass to the writing function `fun`.
#' @param local Logical. If `TRUE`, a local copy of the file will also be
#' created at the specified path. Default is `FALSE`.
#'
#' @inheritSection cloud_guess_write_fun Default writing functions
#'
Expand Down
3 changes: 1 addition & 2 deletions R/s3_transfer.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,12 @@ cloud_s3_download <- function(file, root = NULL) {
#'
#' @inheritParams doc_file
#' @inheritParams cloud_s3_ls
#' @inheritParams doc_local
#'
#' @param x An R object to be written to S3.
#' @param fun A custom writing function. If `NULL` (default), the appropriate
#' writing function will be inferred based on the file's extension.
#' @param ... Additional arguments to pass to the writing function `fun`.
#' @param local Logical. If `TRUE`, a local copy of the file will also be
#' created at the specified path. Default is `FALSE`.
#'
#' @inheritSection cloud_guess_write_fun Default writing functions
#'
Expand Down
11 changes: 9 additions & 2 deletions man/cloud_drive_write.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions man/cloud_drive_write_bulk.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions man/cloud_s3_write.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions man/cloud_s3_write_bulk.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions man/doc_local.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cc14908

Please sign in to comment.