diff --git a/R/doc.R b/R/doc.R index ccf8521..0b77f85 100644 --- a/R/doc.R +++ b/R/doc.R @@ -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) {} diff --git a/R/drive_transfer.R b/R/drive_transfer.R index f64284a..a66394a 100644 --- a/R/drive_transfer.R +++ b/R/drive_transfer.R @@ -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 #' diff --git a/R/s3_transfer.R b/R/s3_transfer.R index 827644e..7617b68 100644 --- a/R/s3_transfer.R +++ b/R/s3_transfer.R @@ -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 #' diff --git a/man/cloud_drive_write.Rd b/man/cloud_drive_write.Rd index 5ae39a5..6761abf 100644 --- a/man/cloud_drive_write.Rd +++ b/man/cloud_drive_write.Rd @@ -17,8 +17,15 @@ writing function will be inferred based on the file's extension.} \item{...}{Additional arguments to pass to the writing function \code{fun}.} -\item{local}{Logical. If \code{TRUE}, a local copy of the file will also be -created at the specified path. Default is \code{FALSE}.} +\item{local}{Logical, defaulting to \code{FALSE}. If \code{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 +\code{overwrite}) to control this behavior. Check the documentation of the +writing function used to determine the exact parameter name and pass it +through the \code{...} argument if necessary. Alternatively, you can define an +anonymous function for \code{fun} that calls a writing function with the +overwriting option enabled.} \item{root}{Google Drive ID or URL of the project root. This serves as the reference point for all relative paths. When left as \code{NULL}, the root is diff --git a/man/cloud_drive_write_bulk.Rd b/man/cloud_drive_write_bulk.Rd index b4b0bf9..f9eb08b 100644 --- a/man/cloud_drive_write_bulk.Rd +++ b/man/cloud_drive_write_bulk.Rd @@ -21,8 +21,15 @@ writing function will be inferred based on the file's extension.} \item{...}{Additional arguments to pass to the writing function \code{fun}.} -\item{local}{Logical. If \code{TRUE}, a local copy of the file will also be -created at the specified path. Default is \code{FALSE}.} +\item{local}{Logical, defaulting to \code{FALSE}. If \code{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 +\code{overwrite}) to control this behavior. Check the documentation of the +writing function used to determine the exact parameter name and pass it +through the \code{...} argument if necessary. Alternatively, you can define an +anonymous function for \code{fun} that calls a writing function with the +overwriting option enabled.} \item{quiet}{all caution messages may be turned off by setting this parameter to \code{TRUE}.} diff --git a/man/cloud_s3_write.Rd b/man/cloud_s3_write.Rd index d840cb9..0f8841d 100644 --- a/man/cloud_s3_write.Rd +++ b/man/cloud_s3_write.Rd @@ -17,8 +17,15 @@ writing function will be inferred based on the file's extension.} \item{...}{Additional arguments to pass to the writing function \code{fun}.} -\item{local}{Logical. If \code{TRUE}, a local copy of the file will also be -created at the specified path. Default is \code{FALSE}.} +\item{local}{Logical, defaulting to \code{FALSE}. If \code{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 +\code{overwrite}) to control this behavior. Check the documentation of the +writing function used to determine the exact parameter name and pass it +through the \code{...} argument if necessary. Alternatively, you can define an +anonymous function for \code{fun} that calls a writing function with the +overwriting option enabled.} \item{root}{S3 path of the project root. This serves as the reference point for all relative paths. When left as \code{NULL}, the root is automatically diff --git a/man/cloud_s3_write_bulk.Rd b/man/cloud_s3_write_bulk.Rd index 5f94075..4a65737 100644 --- a/man/cloud_s3_write_bulk.Rd +++ b/man/cloud_s3_write_bulk.Rd @@ -21,8 +21,15 @@ writing function will be inferred based on the file's extension.} \item{...}{Additional arguments to pass to the writing function \code{fun}.} -\item{local}{Logical. If \code{TRUE}, a local copy of the file will also be -created at the specified path. Default is \code{FALSE}.} +\item{local}{Logical, defaulting to \code{FALSE}. If \code{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 +\code{overwrite}) to control this behavior. Check the documentation of the +writing function used to determine the exact parameter name and pass it +through the \code{...} argument if necessary. Alternatively, you can define an +anonymous function for \code{fun} that calls a writing function with the +overwriting option enabled.} \item{quiet}{all caution messages may be turned off by setting this parameter to \code{TRUE}.} diff --git a/man/doc_local.Rd b/man/doc_local.Rd new file mode 100644 index 0000000..3e8fb8d --- /dev/null +++ b/man/doc_local.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/doc.R +\name{doc_local} +\alias{doc_local} +\title{Package-wide description of \code{local} parameter} +\usage{ +doc_local(local) +} +\arguments{ +\item{local}{Logical, defaulting to \code{FALSE}. If \code{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 +\code{overwrite}) to control this behavior. Check the documentation of the +writing function used to determine the exact parameter name and pass it +through the \code{...} argument if necessary. Alternatively, you can define an +anonymous function for \code{fun} that calls a writing function with the +overwriting option enabled.} +} +\description{ +A dummy function to be referred by \verb{@inheritParams} for a +parameter documentation. +} +\keyword{internal}