Interface to 'Digital Ocean'

Provides a set of functions for interacting with the 'Digital Ocean' API <>, including creating images, destroying them, rebooting, getting details on regions, and available images.

Build Status Build status rstudio mirror downloads cran version

analogsea is an R client for version 2 of the Digital Ocean API. It allows you to programatically create and destroy droplets (remote computers), and install various R related tools: (these are still a work in progress):

  • R (done)
  • RStudio Server (done)
  • RStudio Shiny Server (done)
  • OpenCPU (not yet)
  • Use packrat to move a project to a droplet (not yet)

Stable version from CRAN


Development version from GitHub


Create a DO account

If you don't already have one, create a DO account. By using this link, you'll start with $10 in credits (enough for >600 hours of computing on a 1 gb machine), and if you become a digital ocean customer we'll get some DO credits for us to offset our costs for testing. Thanks :)


The best way to authenticate is to generate a personal access token ( and save it in an environment variable called DO_PAT. If you don't do this, you'll be prompted to authenticate in your browser the first time you use analogsea.

Make sure you provide digitial ocean your public key at Github has some good advice on creating a new public key if you don't already have one:

Get droplets

All droplets

<r> droplets()
<droplet>unintrenchable (2724525)
  Status: off
  Region: San Francisco 1
  Image: Ubuntu 14.04 x64
  Size: 512mb ($0.00744 / hr)
<droplet>basipterygium (2724526)
  Status: active
  Region: San Francisco 1
  Image: Ubuntu 14.04 x64
  Size: 512mb ($0.00744 / hr)

A single droplet. Pass in a single droplet id.

<droplet>unintrenchable (2724525)
  Status: off
  Region: San Francisco 1
  Image: Ubuntu 14.04 x64
  Size: 512mb ($0.00744 / hr)

Spin up a new droplet

To make this as dead simple as possible, you just use one function, without any parameters.

Using default ssh key: Scott Chamberlain
NB: This costs $0.00744 / hour  until you droplet_delete() it
<droplet>sabaoth (2727258)
  Status: new
  Region: San Francisco 1
  Image: Ubuntu 14.04 x64
  Size: 512mb ($0.00744 / hr)

You can of course pass in lots of options for name of the droplet, RAM size, disk size, ssh keys, etc. See regions() and sizes() to list available regions and sizes.

Delete a droplet



Most of the droplet_* functions can be chained together using the %>% function. For example, you can turn a droplet off, snapshot, and then turn it back on with:

d %>%
   droplet_power_off() %>%
   droplet_snapshot() %>%
   droplet_power_on() %>%


We're still working on these, but would love feedback.

Install RStudio Server

This requires a "docklet", a droplet with docker installed:

docklet_create() %>%

This will install R, RStudio Server and it's dependencies. It will automatically pop open the RStudio server instance in your default browser, with default username/password of rstudio/rstudio.


Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.


analogsea 0.6.0


  • as.key function changed to as.sshkey to avoid collision with openssl package (#126)
  • Gains new functions domain_record_update to update a domain record and domain_record to get a domain record by id (#124)
  • domain_record_create gains paramater ttl for time to live for the domain record, in seconds (#124)


  • Fixed some typos (#131) thanks @patperu
  • docklet_rstudio, docklet_shinyserver, and docklet_shinyapp now return a droplet instead of a URL so they can be piped - docs now contain how to construct the URL for the rstudio or shiny server instance in case user sets browse = FALSE (#134)
  • domain_record_create and domain_record_update gain parameters flags and tag for CAA support for Domain Record resources (#137)
  • docklet_images gets an all param, with default value of TRUE (#135)
  • Added examples to docs for how to install specific R versions easily with docker, see ?docklet_create (#106)


  • Fix to droplet_create: it couldn't generate a random name without first loading the package via library (#125) thanks @trestletech
  • debian_add_swap adds swap memory, but was not persisted across reboots. fixed now (#127) thanks @trestletech
  • In droplet_create, the parameters ssh_keys and tags now default to list() instead of NULL as they path pass to I() that warns now on NULL (#129)


  • tag_rename is now defunct as is you can no longer rename tags (#123)

analogsea 0.5.0


  • New function docklets_create() to create many docklets at once (similar to droplets_create()) (#120)
  • New volumes methods for the new block storage (aka volumes) volume, volume_action, volume_actions, volume_attach, volume_create, volume_delete, volume_detach, volume_resize, volume_snapshot_create, volume_snapshots, volumes, as.volume (#121)
  • New methods for new unified snapshots DO endpoints: snapshot, snapshots, snapshot_delete, and as.shapshot (#121)


  • You can now pass tags to the parameter of the same name when creating droplets, with either droplet_create, droplets_create, docklet_create, or docklets_create. The tags can be existing ones, or if not they will be created (#122)
  • Added more help on ssh keys to pkg level man file and to vignette (#115)

analogsea 0.4.0


  • Suite of new functions for tags: tag(), tag_create(), tag_delete(), tag_rename(), tag_resource(), tag_resource_delete(), tags(), and as.tag() (#117)
  • Related to last bulllet: droplet_delete() gains new parameter tag; droplets() gains new parameter tag, and examples added to its man file for tag usage.
  • New functions docklet_shinyserver() and docklet_shinyapp() to spin up Shiny server and a Shiny app, respectively. (#100)
  • New function droplet_enable_backups() (#110)
  • New function droplets_create() to create many droplets at once (#112)
  • New function droplets_cost() to calculate cost of droplets across one or more droplets.


  • Added floating_ip_limit field to account() print method (#111)
  • Improved description of name parameter for droplet_create() and docklet_create()


  • Fixed problem with docklet_create() when port 22 is not open before further action is taken on the droplet. We now check if port 22 is open and error with informative message about waiting a bit for it to open (#113) thanks @fmichonneau @hrbrmstr
  • Fixed problem in the print.droplet due to problem in droplet_ip() internal function (#109)
  • Fix to *_create to allow flexibility in how often DO API is pinged. Previously we pinged every second, meaning you could hit your API rate limit fastish. Now you can set an option do.wait_time to tweak time bewtween pings to check for droplet creation (or other actions). See for example of doing droplet creation in parallel. (#108) thanks @simecek !
  • Fixed parsing bug in sizes() (#119)

analogsea 0.3.0


  • Released to CRAN.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.0.3 by Mauricio Vargas, 19 days ago (devel) (docs)

Report a bug at

Browse source code at

Authors: Scott Chamberlain [aut] , Hadley Wickham [aut] , Winston Chang [aut] , Bob Rudis [ctb] , Bryce Mecum [ctb] , Mauricio Vargas [aut, cre] , RStudio [cph]

Documentation:   PDF Manual  

Task views: Web Technologies and Services

Apache License (>= 2) license

Imports stats, utils, httr, jsonlite, magrittr, yaml

Suggests testthat, knitr, ssh, aws.s3

Imported by plumberDeploy.

Suggested by distribglm.

See at CRAN