Colin 🤘🌱🏃‍♀️ Profile picture
🧑‍💻 "Chaotic Good Developer" at @Thinkr_FR 🦹‍♀️ Long-distance runner 🏃‍♀️ Vegan 🌱 Metalhead 🤘Here to complain about computers 💻

Jul 25, 2018, 14 tweets

💬 "If you're aiming at humans only, you can build a shiny app. If you want machines to access your data, build an API"

💬 "And remember that any other language can access your R API. You're opening a lot of doors."

#RStats

Some important things to know when working with APIs:

🕸 About http requests : developer.mozilla.org/en-US/docs/Web…

🚀 About REST API : en.wikipedia.org/wiki/Represent…

💬 "With plumber, you can build an http API around your existing R code. You just need a little decoration."

📦 github.com/trestletech/pl…

💬 "You can then access this function through your browser, with query string syntax"

More about query string syntax : en.wikipedia.org/wiki/Query_str…

📈 Plumber is able to return other type of content, instead of JSON.

Here's an example with dygraphs and htmlwidget

They are called serializers : rplumber.io/docs/rendering…

🚀 Now, time to launch!

Now, what if {plumber} becomes the central point of the data science infrastructure?

-> Writing a plumber API before a Shiny App allows other languages to use this API, instead of just Shiny.

-> R Created models and data-wrangling which are totally portable

▶️ @TrestleJeff does a demo with an "emoji Browser", which shows an heatmap and a graph of emoji sent live.

💬 "Just imagine how painful it would be to write an heatmap in php" 😇

[Some tricks and tricks]

💬 "You can run {plumber} anywhere":

How to deploy {plumber}

▶️ rstudio connect rsconnect::deployAPI() — rstudio.com/products/conne…

▶️ digital ocean with do_provision() — digitalocean.com/?refcode=be73a…

[Some tricks and tricks]

▶️ {plumber} is now integrated in RStudio (see the dailies for more) : dailies.rstudio.com

▶️ swagger is supported, and are generated from the plumberfile : swagger.io

[Some tricks and tricks]

🐜 Debugging — You can debug API the very same way you would debug any R Code.

Use the swagger and `browser()` : stat.ethz.ch/R-manual/R-dev…

What's in the future ?

▶️ Async : github.com/trestletech/pl…

▶️ Testing

▶️ More docs : rplumber.io

▶️ Additional maintainers

To know more about {plumber}:

▶️ Website : rplumber.io

▶️ StackOverflow : stackoverflow.com/questions/tagg…

▶️ GitHub : github.com/trestletech/pl…

▶️ Slides soon on github.com/rstudio/webina…

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling