box_read
will download a file specified by file_id
, and
attempt to read it into memory as an R object. This can be useful, for
example, to read in a .csv
file as a data.frame
.
Converting a file to an R object is by default handled by
rio
's import
function. The only
modification of it's behavior is that json files are not neccesarily
coerced to data.frame
s, but can used to store list
data, too.
In addtion, more specific read functions are provided:
box_read_csv
Reads remote .csv
files as
data.frame
s (via read.csv
)
box_read_tsv
Reads remote .tsv
files as
data.frame
s (via read.delim
)
box_read_json
box_read_excel
Reads remote Microsoft Excel files
as data.frame
s (via read_excel
)
box_read(file_id, type = NULL, version_id = NULL, version_no = NULL,
read_fun = rio::import, fread = FALSE, ...)box_read_csv(file_id, ...)
box_read_tsv(file_id, ...)
box_read_json(file_id, ...)
box_read_excel(file_id, ...)
The box.com id for the file that you'd like to download
MIME type (aka internet media type) used to override the content type returned by the server. See http://en.wikipedia.org/wiki/Internet_media_type for a list of common types
If downloading an older version, the version_id
of
the desired file
The version of the file you'd like to download (starting at 1)
Passed to as additional parameters to read_fun
box_dl
for saving files to disk,
box_save
for working with R workspaces, and
box_source
for working with R code.