Skip to contents

This function downloads a file from an Integral repository to a temporary location and then applies a specified function to read or process the file.

Usage

integral_read(FUN, ..., file, url = getOption("integral_url"))

Arguments

FUN

A function to be applied to the downloaded file. This could be any function that takes a file path as its first argument, such as read.csv, readRDS, etc.

...

Additional arguments to be passed to the FUN function.

file

A character string representing the path of the file within the repository to be downloaded. This can be copied to the clipboard directly from Integral.

url

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

Value

The result of applying the FUN function to the downloaded file.

Details

The function creates a temporary file, downloads the specified file from the Integral repository to this temporary location using integral_download, and then applies the specified FUN function to the temporary file. The temporary file is automatically deleted upon exit from the function.

Examples

if (FALSE) { # \dontrun{

data <- integral_read(
   FUN = read.csv,
   file = "Root Folder/Data/my_data.csv"
   )
} # }