googleformr updates on CRAN

May 3, 2016
By

(This article was first published on data_steve, and kindly contributed to R-bloggers)

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 on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Sponsors

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)