Skip to contents

Write a data file from R to create a new document

Usage

write_data(
  x,
  file_name,
  file_type,
  workspace_uuid,
  ...,
  description = NULL,
  parent_uuid = NULL,
  use_proxy = FALSE
)

Arguments

x

R object to write to file.

file_name

Name to give file.

file_type

Either "csv", "rds" or "xlsx".

workspace_uuid

UUID of the workspace to create the new document in

...

Additional arguments to pass to write function. See details.

description

Optional description of document.

parent_uuid

UUID of folder in the workspace to create the new document within. If not supplied, the document will be created in the top-level of the workspace.

use_proxy

Logical to indicate whether to use proxy

Value

An httr2 httr2::response() (invisibly)

Details

This function can be used to write the following data file types: csv, rds, xlsx. Use the file_type argument to control which file type to create.

The function works by writing the R object to a temporary file and uploading the file to Objective Connect. The following functions are used to write the data and any additional arguments (...) will be passed to these.

File TypeFunction
csvreadr::write_csv()
rdsreadr::write_rds()
xlsxwritexl::write_xlsx()

If there are other data file types you would like to upload using this function, please open an issue on the GitHub repository.