A fast and lazy way to upload R objects to box.com in a commonly readable file format. read_fun is used to convert R objects to files, which by default is the export() function from the rio package.

rio()'s rio::export() function currently only supports data.frames; for lists jsonlite::toJSON() may be more appropriate.

Note: box_write is for writing files in standard formats to box.com. To upload R objects as .RData files, see box_save().

box_write(x, filename, dir_id = box_getwd(), description = NULL,
  write_fun = rio::export, ...)

Arguments

x

An R object

filename

The name for the file to be uploaded

dir_id

If uploading, the box.com folder id that you'd like to upload to.

description

Optional. character. A string to be used as the description caption for the file (added via box_add_description()). Useful for describing the contents of a file, or describing the latest changes made to it. If NULL (the default), no description is added.

write_fun

The function used to write the R object to a file

...

Additional arguments passed to read_fun

Value

An object of class boxr_file_reference.