Profile picture
Colin Fay 🤘 @_ColinFay
, 14 tweets, 11 min read Read on Twitter
💬 "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…
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to Colin Fay 🤘
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member and get exclusive features!

Premium member ($3.00/month or $30.00/year)

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!