Skip to contents

This function facilitates the uploading of one or more files to a folder in a remote Integral repository.

Usage

integral_upload(
  file,
  path,
  reason = NULL,
  url = getOption("integral_url"),
  timeout = getOption("integral_timeout", default = 1200)
)

Arguments

file

A character string or character vector specifying the file path(s) of the local files to be uploaded.

path

A character string or character vector specifying the destination path in the Integral repository where the file should be uploaded. If only the folder name is provided, the file name will be recycled from basename(file).

reason

Optional character string describing the reason for the file upload.

url

A character string representing the base URL of the Integral repository. Defaults to getOption("integral_url").

timeout

A numeric value specifying the length of time in seconds to wait on a request before returning an error. The default timeout value is `1200`. This value can be changed by setting the integral_timout in options() e.g., options("integral_timeout" = 300).

Examples

if (FALSE) { # \dontrun{

write.csv(mtcars, file.path(getwd(), "mtcars.csv"))

integral_upload(
  file = "mtcars.csv",
  path = "Root Folder/Data/mtcars.csv",
  reason = "add data"
  )
  
write.csv(mtcars, "mtcars.csv")
write.csv(cars, "cars.csv")
write.csv(airquality, "airquality.csv")

files_to_upload <- list.files(pattern = "*.csv")

integral_upload(
  file = files_to_upload,
  path = "Root Folder/Data",
  reason = "add more data"
  )
} # }