Recent Releases of boxr
boxr - boxr 0.3.7
Fixes
- fix bug in
box_save(), setting default environment for evaluating dots (#255)
Internal
update with internal helper for Box ids. (#90)
update minimum version of rio package to reflect newer treatment of JSON files. (#261)
remove unused internal function, removing dependency on httpuv package. (#259)
update superseded function-calls from gargle, used in testing. (#251)
default branch switched from
mastertomain. (#252)refactor to use withr functions to handle temp files. (#183)
activate tests for
box_save(),box_load()(#255)update documentation to reflect updates to rio package. (#242, @chainsawriot)
update maintainer's email address. (#248)
update to use
inherits()(vs. string-comparison) to determine class-membership. (#246)harmonizes the default location for tokens. Now,
~resolves to the home directory for all platforms. A patch is applied offering to move tokens from "old" locations. (#219 w/@danielruss)adds and updates GitHub Actions for testing and coverage. (#206, #247, #256)
update documentation: README, URLs, external-package links, pkgdown, add alt text to figures. (#275, #276, #279, #282)
- R
Published by ijlyttle about 1 year ago
boxr - boxr 0.3.6
Improvements
adds
vignette("design")to sketch out the different design philosohies that appear in boxr functions. (#170)deprecates the
xargument tobox_write()in favor ofobject. (#187)some return objects can be printed as tibble (vs. data-frame). To enable this behavior, set
options(boxr.print_tibble = TRUE)(perhaps in your.Rprofile).new tools to manage collaborations:
box_dir_invite()is deprecated in favor ofbox_collab_create().- adds
box_collab_create(), which supports file and group based collaborations. - also adds
box_collab_get()to check existing collaborations, andbox_collab_delete()to delete. box_collab_create()andbox_collab_get()each return the (list-based) response from the Box API. If you prefer to work with data frames, these return-objects each haveas.data.frame()andas_tibble()methods.
box_previous_versions()is superseded in favor ofbox_version_history():- returns a data frame that includes columns
version_no(numeric) andversion_id, rather thanversion(character) andfile_version_id. - exports an internal function
box_version_api(), if you are interested in the unparsed content of the response from the API.
- returns a data frame that includes columns
new function
box_version_number()returns the current version of a file; this number is consistent with theversion_noargument used by functions such asbox_dl().new functions
box_read_rds()andbox_save_rds()to work withRDSfiles directly on Box.new function
box_browse()to open a browser window directly to a given folder or file on Box's web app.new functions
box_comment_create()andbox_comment_get()to create or get comments on Box files. These functions return specially classedlistsof the API response, on which you can useas.data.frame()oras_tibble().uses
httr::RETRY()for API requests to handle momentary issues with network connectivity. Thanks @jameslamb and @chircollab!box_ls()provides the currentversion_idby default. (#185, @alexbrodersen)
Bug Fixes
box_file_delete()andbox_folder_delete()each now returninvisible(NULL). (#197)box_auth_service()more resilient to bad-request failures. (#166)box_auth()longer throws error if {usethis} not installed. (#168, @malcombarret)...is now passed towrite_funinbox_write(). (#144)box_ls()is more robust for remote folders that contain links. (#140)box_previous_versions()fixed for "no-previous-versions" case. (#139)
- R
Published by ijlyttle over 5 years ago
boxr - boxr 0.3.5
Improvements
adds automatic-retry to authentication functions,
box_auth()andbox_auth_service(). (#131)adds
box_auth_service()to support OAuth2.0 using JWT, also addsbox_dir_invite()to invite a collaboration on a Box folder. This makes it easier to authenticate to box.com from remote computers (e.g. RStudio Cloud, RStudio Server) (#23)modifies
box_source(): adds...argument to pass other arguments tosource().modifies
box_write(),box_dl():- deprecates the
filenameargument in favor offile_name.
- deprecates the
modifies
box_auth()(#96):- deprecates
write.Renvargument - copies text to the clipboard, rather than overwrite the
.Renvironfile - returns
invisible(NULL)upon success
- deprecates
deprecates
box_auth_on_attach()(#96)adds a logo (#92, @nathancday)
converts pagination method from offset to marker-based paging (#79, @awong234)
adds option to return specified
fieldsinbox_ls()(#72, @awong234)adds updated screen shots (pngs in
images/) and description for creating a Box App with the new Box Developer Console UI. Also added reference forbox_auth_on_attachin step 4 'And you're done'. (#57, @nathancday)
Bug Fixes
box_pagination()refactored to employ marker-based paging instead of offset-based paging, avoiding a hard limit of 300,000 offset (#74, @awong234)~~fixes bug in
box_pagination()to enforce integer for offset (#71, @awong234)~~ Deprecated, pagination now uses marker-based paging.fixes bug in
box_search_files()(#61, @j450h1)
- R
Published by ijlyttle over 6 years ago
boxr - boxr v0.3.3
Minor Improvements
box_push'signore.dotsparameter now includes directories (65acef7)- Broader validation that users are correctly authenticated (47b16b5)
- Minor improvements to S3 classes (9a64aa0)
- More prominent troubleshooting section in README (8ccdaa5)
- Updated author email address (a23acc0)
Big fixes
- box.com API changes had made the ordering in
box_previous_versionsunreliable (693f5a2)
- R
Published by brendan-r almost 10 years ago
boxr - boxr v0.3.2
Minor Improvements
This release contains some minor changes for compatibility with httr v1.1.0 (boxr's major dependency).
- Some code to work around bugs in the previous versions of httr has been removed
- Some minor tweaks for compatibility (mainly changes in reporting http status codes)
- R
Published by brendan-r over 10 years ago
boxr - boxr v0.3.1
New Features
box_search(and convenience functionsbox_search_files,box_search_folders,box_search_trash) allow use of box.com's superb searching facilities to find files and folders. Various parameters can be set to search filenames, file contents, and to limit searches to certain file types. Results are summarised by default, can be coerced viaas.data.frame. They can also be passed in place of a fileid to other boxr functions (e.g. `boxdl`) to perform an operation on the first result.box_read_excelFinally support for everyone else's favorite way to store data!box_writeA convenience function to convert R objects to common file types (e.g. .json, .csv, .tsv, .xlsx, etc.), and upload to box. Using the default write function (rio::export), the file type can be determined automatically from the filename provided.box_add_descriptionA simple way to add a description to a file on box.com. These are a useful way to decribe the contents of a file, and can also be used like commit messages on GitHub, to describe recent changes made.box_fresh_authA convenience function for users having trouble authenticating -- it will delete existing tokens (which are by default hidden files) for a fresh authentication process- S3 classes for files, folders, and object lists
- Objects of class
boxr_object_listcan be passed directly to functions in place of a file_id string - Objects of class
boxr_object_listnow have anas.data.framemethod
Improvements
- Example of usage with
magrittrpipes is added to the README - box file/folder id's are now validated locally before requests are sent
- Filenames are now validated locally, with helpful/informative error mesages
box_readnow accepts a user specified read function, which is now by defaultrio::importbox_readwill now try and do the right thing for files without an extension by considering the MIME type of the API response- S3 classes and methods have been consolidated into three basic types, and functions now use them in a consistent manner. Now documented for those interested (
?boxr_S3_classes) - Print methods: Prettier and more informative
box_getwdno longer logs an uninformative message- Documentation / collaboration improvements (improved function documentation, variable naming conventions, and a code of conduct)
- Improved tests
Bug Fixes
options(boxr.progress = TRUE)is now respected consistently- Fix for spurious warnings comming from the latest version of
httr(see jeroenooms/curl#30 and hadley/httr#252) - Fix for weird reporting for certain valid API queries, which return exactly 0 results
- R
Published by brendan-r over 10 years ago
boxr - boxr v0.2.9
Note: Skipped a version increment for CRAN iterations
Bug Fixes
- Namespace stuff for the latest Rbuild under Windows
Installtion
Now up on CRAN:
r
install.packages("boxr")
- R
Published by brendan-r almost 11 years ago
boxr - boxr v0.2.7
Bug Fixes
- Fixed broken link for image assets in vignette
Minor Improvements
- The default OAuth2.0 token cache is now
~/.boxr-oauth
- R
Published by brendan-r almost 11 years ago
boxr - boxr v0.2.6
This release contains small changes to help new users get started (especially those who don't get to see the GitHub README).
Minor Improvements
- The package vignette (
vignette("boxr")) is now more oriented towards getting new users up and running (fc931cd), providing much of the same information as at?box_auth, but with screenshots and friendlier formatting - Upon loading boxr, users are now provided with the GitHub issues URL for bug reports. If it looks like the user hasn't used boxr before (
!file.exists("~/.boxr_oauth")), the code to generate the Getting Started vignette is presented (e18864d) - R help 'homepage':
?boxrnow takes the user to a summary of the package, which links back to the Getting Started vignette (#31) - Continuous integration now covers Windows via appveyor (08925e5), and for useRs coming from GitHub, there's a few more visual aids in the README to help them evaluate/grok the package (1c574c2, 593101d, 670487b)
Installation
boxr v0.2.6 is on CRAN, the following will do the trick:
r
install.packages("boxr")
- R
Published by brendan-r about 11 years ago
boxr - boxr v0.2.5
CRAN Release
- LO!
- http://cran.r-project.org/web/packages/boxr/
Bug Fixes
- json is now parsed consistently by
box_read()andbox_read_json() box_getwd()andbox_setwd()now write to the correct options vars (e.g., work properly again) (#27)
Minor Changes
- General CRAN policy stuff
- Improved tests (f6cc01c, 55d6581)
- R
Published by brendan-r about 11 years ago
boxr - boxr v0.2.0
New Features
- Several new wrapper functions for
box_readhave been added (#25):box_read_csvbox_read_tsvbox_read_json
box_previous_versionsallows you to query previous versions of a filebox_dlcan now download specific versions of a file, via either theversion_noorversion_idparameter (#21)
Minor Changes
- URLs for the set-up process now point to https://www.box.com/developers/services, as opposed to https://www.box.com/developers/services (#20)
- R
Published by brendan-r about 11 years ago
boxr - boxr v0.1.1 - v0.1.2
Minor Changes
Tiny changes to make the package more amenable to CRAN (not there yet!)
- R
Published by brendan-r about 11 years ago
boxr - boxr v0.1.0
Minor Improvements
- Much more thorough documentation (#1, #3, #16)
box_dir_diffnow has it's own S3 class (#16)
- R
Published by brendan-r about 11 years ago
boxr - Initial Release
boxr
A lightweight, high-level R interface for the box.com API, standing on the shoulders of httr.
Installation
boxr is not currently on CRAN. You can install the development version from github with
``` R
install.packages("devtools")
devtools::install_github("brendan-R/boxr") ```
Usage
Basic Operations
Aside from file upload/download, boxr provides functions which mirror base R operations for local files.
- box_dl(file_id) and box_ul(file = 'path/to/file') to download and upload files respectively
- box_load()/box_save() for remote R workspaces
- box_read() to read files straight into R (e.g. .csv files as data.frames)
- box_setwd()/box_getwd() to get/set a default box folder
- box_source() to read and execute remote code
Directory wide Operations
Cloud storage services can complement version control systems for code, which aren't well suited to large binary files (e.g. databases, .RData, or heaps of pdfs). box explicitly versions binary files, keeping old ones, and making it easy fall back to an older copy.
boxr provides git style facilities to upload, download, and synchronize the contents of entire local and remote directories. At the time of writing, the box.com API does not support this directly, and so boxr recursively loops through directory structures.
- box_push will update the remote directory with new/changed local files
- box_fetch will update the local directory with new/changed remote files
These functions all have overwrite and delete parameters, which are set to FALSE by default.
Disclaimer: box.com is no replacement for a VCS/remote-database, and familiar verbs are no guarantee of expected behavior! Do check the function documentation before jumping in.
File/Folder IDs
Are how box.com identifies things. You can find them in an item's URL:

Getting set up
To use boxr, you need to enable API access for your box.com account. The process is slightly annoying. You only need to do it once - it takes around 2 minutes.
1. 'Create an app'
At https://www.box.com/developers/services, log in and create a new 'app' for your box.com account. You can call it anything you like. This won't do anything remotely like creating an app, but it does allow you to access your account via the API.
2. Set OAuth2 Parameters
On the next screen, you'll want to set Content API Access Only, and http://localhost as your redirect_uri as in the screenshot below.

3. Connect boxr to your account
This means passing your clientid and clientsecret to the box_auth function. These strings are not enough for someone to access your account maliciously. However, it's still a good idea to keep them safe, and out of any files or code which might be shared with others.
Run:
R
library(boxr)
box_auth()
And paste/type the client_id and client_secret when prompted. If these are valid, a browser window should open, for you to formally grant yourself access to your files at box.com.
4. And you're done
If box_auth() worked successfully, you won't need to do any of this again, and thanks to the magic of httr everything should just work. Your clientid and clientsecret will be securely stored in your R environment variables, your hashed OAuth2.0 token will stored at ~/.boxr-oauth, .gitignore'd if necessary, and automatically refreshed when needed.
Notes
Verbosity
boxr is by default rather verbose, printing status to the console with cat. This is 'rude' package behaviour, and may cause unwanted output if used in conjunction with the excellent knitr package.
To supress messages produced using cat, set boxr's verbose option with:
R
options(boxr.verbose = FALSE)
Alternatives
boxr aims to expedite data analysis/communication/distribution. Other ways to manipulate a box.com account include: - The box desktop app - The other boxr, written in Ruby. It's 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
Managing your client id & secret
If you don't like the idea of typing credentials into your console, you can put them straight into ~/.Renviron yourself, prior to the R session:
``` BOXCLIENTID="youridhere" BOXCLIENTSECRET="yoursecrethere"
```
(Note the final blank line).
- R
Published by brendan-r about 11 years ago