googleformr updates on CRAN

[This article was first published on data_steve, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Main updates to googleformr have been to remove an internal dependency on magrittr chains in the function construction and to take http status checking outside of the main gformr function and into a check_form_works function. Both changes provide notable speed gains.

One can still create a function with gformr as before:

form <- "your_google_form_url"
my_fun <- googleformr::gformr(form
                              , custom_reply = "my reply")

And then you can test that it works by:

  • sending a test message to your Google Form and see if it shows up and/or
  • using the check_form_works function like so: check_form_works( my_fun("test") ).

Either “All good” will appear in the console or a specific http status message describing the error.

As before, users of your function can post content back to your form via code like below:

my_fun(post_content)

In addition to speed gains, taking http status checking outside gformr also the benefits of conforming better to good design principles such as of separation of concerns and DRY: the developer is the one who needs to status checking. But this is only once and at development time; the useRs repeated experience of the function afterwards is the custom reply option the developer chooses, if at all.

Over the next two weeks, a series of blog posts will lay out ways in which googleformr as an API has been used for general purpose data science tasks around the office and for package development.

googleformr

googleformr updates on CRAN was originally published by Steve Simpson at data_steve on May 03, 2016.

To leave a comment for the author, please follow the link and comment on their blog: data_steve.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)