A lightweight, opinionated, high-level R interface to the box.com API, standing on the shoulders of httr.
Box is a cloud content-management and file-sharing service. The goal of the boxr package is to make it easier for you to integrate your Box account into your R workflow.
- Harmonizes the default location for tokens;
~
resolves to the home directory for all platforms. A patch is applied offering to move tokens from “old” locations. This bug appeared on Windows only.
All changes are detailed in the NEWS.
You can install boxr from CRAN, with:
install.packages("boxr")
If you’d like to install the development version from GitHub, use:
# install.packages("devtools")
devtools::install_github("r-box/boxr")
The package-documentation website is created and maintained using pkgdown. The documentation website consists of:
We have a Get-started article that goes into more detail on interacting with your Box account using R.
If you have access to client_id
and client_secret
for a Box-app, you
can use box_auth()
to authenticate:
box_auth(client_id = "your_client_id", client_secret = "your_client_secret")
This will kick off a process that, all being well, will keep you
authenticated for the rest of the R session. By saving this information
to your .Renviron
file, at your next R session you can use, without
arguments:
box_auth()
If you don’t have access to client_id
and client_secret
, you should
read the authentication
article to
determine your next steps. In most cases, this next step will be to
create an interactive
Box-app
To use boxr
with enterprise accounts, the box_url
parameter must be
set:
box_auth(client_id = "your_client_id", client_secret = "your_client_secret", box_url = "https://wayne-enterprises.ent.box.com")
You can also set the BOX_URL
environment variable to your URL.
- Accessing Box
files:
box_ul()
,box_dl()
,box_version_history()
. - Accessing Box
directories:
box_setwd()
,box_getwd()
,box_dir_create()
,box_ls()
,box_search()
. - Directory-wide
operations:
box_push()
,box_fetch()
.
- Interactng with Box
files:
box_collab_create()
,box_comment_create()
,box_add_description()
. - Using Box
trash:
box_delete_file()
,box_delete_folder()
,box_restore_file()
,box_restore_folder()
. - Interacting with your R
session:
box_read()
,box_write()
,box_read_rds()
,box_save_rds()
,box_save()
,box_load()
,box_browse()
.
Other ways to interact with a Box account include:
- The Box desktop apps.
- The other boxr, written in Ruby. Its motivations are rather different, and it covers 100% of the box.com API (e.g account administration, etc.).
- Box themselves provide a wide range of SDKs, including one for Python.
Always very welcome! If you’d like to submit a pull request for a new feature, ideally it would be documented, come with an addition to NEWS.md, and have a test or two. This project has a standard Code of Conduct.
The MIT License (MIT)
Copyright (c) 2015-2023 boxr contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.