<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="http://www.r-bloggers.com/feedbackr-%e2%a4%8c-r-devs-users/"></div></div><div><a data-url="http://www.r-bloggers.com/feedbackr-%e2%a4%8c-r-devs-users/" data-counturl="http://www.r-bloggers.com/feedbackr-%e2%a4%8c-r-devs-users/" data-count="horizontal" data-text="feedbackr  ⤌  R-devs  + useRs" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://data-steve.github.io/feedbackr-for-user-feedback/"> data_steve</a></strong>, and kindly contributed to <a rel="nofollow" href="http://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><img alt="" src="http://i0.wp.com/data-steve.github.io/images/phone_string.png?w=456" data-recalc-dims="1"><br>
<a target="_blank" href="https://upload.wikimedia.org/wikipedia/commons/5/53/Tel%C3%A9fono_de_cordel_(1882).jpg">from Wikimedia</a></p>
<p>In <a target="_blank" href="http://data-steve.github.io/need-user-feedback-send-programmatically">my last post</a> I explained why I added a feedback function to googleformr. Since googleformr is an API for collecting data programmatically, I figured I’d leverage it for package development and accessibility. Below I’ll show how you can add your own feedback function to your package.</p>
<h1>Create your own feedback function</h1>
<p>First, make sure to grab <strong>googleformr</strong> from CRAN, if you haven’t yet. <a target="_blank" href="http://data-steve.github.io/let-pacman-eat-up-library-and-require/">I love <strong>pacman</strong> as my library / function handler</a>. The <code>p_load</code> will load a library. If it isn’t installed, it will install from CRAN and then load it.</p>
<div>
<pre><code>  if (!require(&quot;pacman&quot;)) install.packages(&quot;pacman&quot;)
  pacman::p_load(googleformr)
</code></pre>
</div>
<p>You can create your own <code>feedback_pkg_name</code> function by linking it to a Google Form. Get your forms started at the <a target="_blank" href="https://www.google.com/forms/about/">Google Forms page</a>. Once you have a google form created with one short answer question, grab the form’s url and use code below:</p>
<div>
<pre><code>  # create function
  form &lt;- &quot;your_google_form_url&quot;
  feedback_pkg_name &lt;- gformr(form
                              , custom_reply = &quot;Thanks for supporting pkg_name&quot;)
</code></pre>
</div>
<p>Note: it is recommended to call your feedback function</p>
<ul>
<li>something clearly signalling a feedback purpose</li>
<li>but also something specific to your package.</li>
</ul>
<p>So a function name following the pattern <code>feedback_pkg_name</code> should get the best of easy IntelliSense auto-complete and distinguishability from other packages using the same functionality.</p>
<p>Once you re-document and re-build your package and post it to github or CRAN, your users can send feedback directly to you from the R console by simply putting their feedback into your feedback function.</p>
<div>
<pre><code>  fdbk &lt;-  # their comments
  feedback_pkg_name(fdbk)
</code></pre>
</div>
<h1>Helper Functionality</h1>
<p>You can test that your new <code>feedback_pkg_name</code> function works by:</p>
<ul>
<li>sending a test message to your Google Form and see if it shows up and/or</li>
<li>using the <code>check_form_works</code> function like so: <code>check_form_works( comments_pkg_name(&quot;test&quot;) )</code>. Either “All good” will appear or a specific http status message describing the error.</li>
</ul>
<p>You can also extract Google Form question text or entry points using to make sure you can bring back the same information as is on your form:</p>
<div>
<pre><code># questions
form &lt;- &quot;your_google_form_url&quot;
form %>% get_form() %>% get_form_questions()

# entry ids
form %>% get_form() %>% get_form_entry_ids()
</code></pre>
</div>
<p><a target="_blank" class="twitter-share-button" data-via="data_steve" data-size="large" data-hashtags="rstats,googleapps," data-dnt="true" href="https://twitter.com/share">Tweet</a><a data-style="mega" target="_blank" href="https://github.com/data-steve/googleformr" data-icon="octicon-star">googleformr</a> </p>
<p><div><div><div><div data-width="55" data-show-faces="false" data-send="true" data-layout="box_count" data-height="62" data-href="http://www.r-bloggers.com/feedbackr-%e2%a4%8c-r-devs-users/"></div></div><div><a data-url="http://www.r-bloggers.com/feedbackr-%e2%a4%8c-r-devs-users/" data-counturl="http://www.r-bloggers.com/feedbackr-%e2%a4%8c-r-devs-users/" data-count="vertical" data-text="feedbackr  ⤌  R-devs  + useRs" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://data-steve.github.io/feedbackr-for-user-feedback/"> data_steve</a></strong>.</div>
<hr>
<a rel="nofollow" href="http://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="http://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="http://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="http://www.r-bloggers.com/?s=data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="http://www.r-bloggers.com/?s=Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="http://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="http://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" rel="nofollow" href="http://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="http://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="http://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="http://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="http://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="http://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="http://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="http://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="http://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="http://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" rel="nofollow" href="http://www.r-bloggers.com/?s=time+series">time series</a>, <a title="finance trading" rel="nofollow" href="http://www.r-bloggers.com/?s=trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/dJrU1tNpFsg"></a></div>