💬 "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."

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

Keep Current with Colin 🤘🌱🏃‍♀️

Colin 🤘🌱🏃‍♀️ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!


Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @_ColinFay

Aug 8, 2018
#RStats — What's up CRAN?

In the past 7 months:

🆕 1178 new 📦

🆓 18 unarchived 📦

⏹ 493 archived 📦
At the end of June, there were around 12500 📦 on the CRAN
Changes on CRAN check ✅

See stats.ox.ac.uk/pub/bdr/Rblas/… for more info
Read 9 tweets
Jul 10, 2018
[Thread #RStats #Programming ]
Some important points taken from "Object-Oriented Programming, Functional Programming and R", by John M. Chambers
An article about what is Functional Programming (FP), and how does it differ from Object Oriented Programming (OOP) ?
Note that both these paradigms are used in R, and interact with each others.
Here’s the definition of what FP is :
- Programming == creating function
- Functions returns values computed from arguments (and only these)
- A function has no side effect
Read 20 tweets
Jun 11, 2018
Why do we use arrow `<-` instead of equal `=` for assignment in #RStats :
It’s an historical choice: R comes from S, which used <- for assignment. S uses `<-` partly because it is inspired by APL, which had the ← operator for assignment, as it was developed for this keyboard, which has a key for arrow :
Not that at that time, with APL, the arrow was chosen because it distinguished from the equal operator (there were no `==` for testing equality).
See : softwarepreservation.org/projects/apl/B…
Read 16 tweets
May 12, 2018
Current status: looking for more memes to put in my @erum2018 talk.
#RStats #eRum2018
So far, I've got:
Read 8 tweets

Did Thread Reader help you today?

Support us! We are indie developers!

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

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

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

Donate via Paypal

Or Donate anonymously using crypto!


0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy


3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!