<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/getting-ready-to-attend-ropensci-unconf18-and-probably-working-on-tidyverse-like-functions-for-the-first-time/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://feedproxy.google.com/~r/FellgernonBit-rstats/~3/PbdtvPZc_s4/"> Fellgernon Bit - rstats</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>It’s Friday 7pm and it’s been a long week with ups and downs<a rel="nofollow" href="http://feedproxy.google.com/~r/FellgernonBit-rstats/~3/PbdtvPZc_s4/#fn1" target="_blank"><sup>1</sup></a>. But I’m enthused as I write this blog post. In less than a month from now I’ll be attending <a rel="nofollow" href="http://unconf18.ropensci.org/" target="_blank">rOpenSci unconf18</a> and it’ll be my first time at this type of event. Yay!</p>
<blockquote class="twitter-tweet">
<p lang="en" dir="ltr">Building on my streak of good news, I'm delighted to have been selected to attend <a rel="nofollow" href="https://twitter.com/rOpenSci?ref_src=twsrc%5Etfw" target="_blank">@rOpenSci</a> <a rel="nofollow" href="https://twitter.com/hashtag/Unconf18?src=hash&ref_src=twsrc%5Etfw" target="_blank">#Unconf18</a> <a rel="nofollow" href="https://t.co/Xe6lojB7TS" target="_blank">https://t.co/Xe6lojB7TS</a> ^_^ Also, thanks to the <a rel="nofollow" href="https://t.co/o5OwUWEaBD" target="_blank">https://t.co/o5OwUWEaBD</a> and <a rel="nofollow" href="https://twitter.com/LieberInstitute?ref_src=twsrc%5Etfw" target="_blank">@LieberInstitute</a> for their support! I'm hoping to relay as much as I can to <a rel="nofollow" href="https://twitter.com/LIBDrstats?ref_src=twsrc%5Etfw" target="_blank">@LIBDrstats</a> <a rel="nofollow" href="https://twitter.com/hashtag/rstats?src=hash&ref_src=twsrc%5Etfw" target="_blank">#rstats</a></p>
<p>— L. Collado-Torres (@fellgernon) <a rel="nofollow" href="https://twitter.com/fellgernon/status/983876013015826432?ref_src=twsrc%5Etfw" target="_blank">April 11, 2018</a></p></blockquote>
<p></p>
<p>In my self introduction to everyone attending, I mentioned that I don’t use the pipe (<code>%>%</code>) symbol and that I use <code>&lt;-</code> for assignment.</p>
<p><img src="https://i2.wp.com/lcolladotor.github.io/post/2018-04-27-getting-ready-to-attend-ropensci-unconf18-and-probably-working-on-tidyverse-like-functions-for-the-first-time_files/Screen%20Shot%202018-04-27%20at%207.11.14%20PM.png?w=450" data-recalc-dims="1"> Recently I had my pre-unconf chat with <a rel="nofollow" href="https://ropensci.org/about/#team" target="_blank">Stefanie Butland</a> (read more about these chats <a rel="nofollow" href="https://blog.trelliscience.com/the-value-of-welcome-part-2-how-to-prepare-40-new-community-members-for-an-unconference/" target="_blank">in her great blog post</a>). In my notes to Stefanie before our chat I had mentioned again my lack of R piping experience and we talked about it. As we talked, it became clear that a blog post on related topics would be useful. Sure, I could have asked directly to the other unconf18 participants, but maybe others from the R community in general can chime in or benefit from reading the answers.</p>
<div>
<h3>Coding style and git</h3>
<p>I’m attending unconf18 with an open mind and I think of myself as someone who can be quite flexible (not with my body!) and accommodating. I’m assuming that most participants at unconf18 will use <code>=</code> for assignment. I’m not looking to start any discussions about the different assignment operators. Simply, I am willing to use whatever the majority uses. Just like I did in my first pull request to the <code>blogdown</code> package (<a rel="nofollow" href="https://github.com/rstudio/blogdown/pull/263" target="_blank">issue 263</a>). I was trying to follow Yihui Xie’s coding style to make his life easier and have a clean (or cleaner) git history. From <a rel="nofollow" href="https://yihui.name/en/2018/02/bite-sized-pull-requests/" target="_blank">Yihui’s post on this pull request</a> I can see that he liked it.</p>
<p>Keeping this in mind, I think that following the coding style of others will be something I’ll do at unconf18. I haven’t really worked in any R packages with many developers actively working on the package. But I imagine that setting a common coding style will minimize git conflicts, and <strong>no one</strong> wants those<a rel="nofollow" href="http://feedproxy.google.com/~r/FellgernonBit-rstats/~3/PbdtvPZc_s4/#fn2" target="_blank"><sup>2</sup></a>. I don’t know if we’ll all follow some common guidelines at unconf18. I actually imagine that it’ll be project-specific. Why? Well because you can create an R project in RStudio<a rel="nofollow" href="http://feedproxy.google.com/~r/FellgernonBit-rstats/~3/PbdtvPZc_s4/#fn3" target="_blank"><sup>3</sup></a> and set some defaults for the project such as:</p>
<ul>
<li>the number of spaces for tab</li>
<li>line ending conversions</li>
</ul>
<div>
<img src="https://i0.wp.com/lcolladotor.github.io/post/2018-04-27-getting-ready-to-attend-ropensci-unconf18-and-probably-working-on-tidyverse-like-functions-for-the-first-time_files/Screen%20Shot%202018-04-27%20at%207.27.27%20PM.png?w=400" data-recalc-dims="1">
</div>
<p>We can also set some global RStudio preferences like whether to <em>auto-indent code after paste</em>, length of lines.</p>
<p><img src="https://i2.wp.com/lcolladotor.github.io/post/2018-04-27-getting-ready-to-attend-ropensci-unconf18-and-probably-working-on-tidyverse-like-functions-for-the-first-time_files/Screen%20Shot%202018-04-27%20at%207.28.49%20PM.png?w=400" data-recalc-dims="1"> Additionally, we can decide whether we’ll use the RStudio “wand” to <em>reformat code</em>.</p>
<div>
<img src="https://i2.wp.com/lcolladotor.github.io/post/2018-04-27-getting-ready-to-attend-ropensci-unconf18-and-probably-working-on-tidyverse-like-functions-for-the-first-time_files/Screen%20Shot%202018-04-27%20at%207.31.29%20PM.png?w=300" data-recalc-dims="1">
</div>
<p>Maybe all of this is unnecessary, maybe everyone will work in different non-overlapping functions and thus avoid git conflicts. For example, at my job sometimes I write code with <code>=</code> users, but we don’t work on the same lines of the code file. Later on it becomes easy to identify who wrote which line without having to use <code>git blame</code> (awful name, right?).</p>
</div>
<div>
<h3>Tidyverse-like functions</h3>
<p>So far, I think that these coding style issues are minor and will be easily dealt with. I think that we’ll all be able to adapt and instead focus on other problems (like whatever the package is trying to solve) and enjoy the experience (network, build <strong>trust</strong> as Stefanie put it).</p>
<p>My second concern has to do with something I imagine could require more effort: my homework before the unconf. That is, writing tidyverse-like functions. Like I’ve said, I haven’t used the R pipe <code>%>%</code> symbol. I’ve executed some code with it before, seeing it in many blog posts, but I’ve never actually written functions designed to be compatible with this type of logic.</p>
<p>If I help write a function that is not pipe-friendly, then it might not integrate nicely with other functions written by the rest of the team. It would lead to workarounds in the vignette or maybe having someone else re-factor my first function to make it pipe-friendly. Sure, I would learn from observing others make changes to my code. But I want to take advantage as much as I can from my experience at rOpenSci unconf<a rel="nofollow" href="http://feedproxy.google.com/~r/FellgernonBit-rstats/~3/PbdtvPZc_s4/#fn4" target="_blank"><sup>4</sup></a>!</p>
<p>Since I don’t really use <code>%>%</code>, I’m unfamiliar with many things related to pipe-friendly (tidyverse-like) functions. For example:</p>
<ul>
<li>Do you document them differently? Like make a single Rd file for multiple functions. Or do you make an Rd file per function even if the example usage doesn’t involve <code>%>%</code>?</li>
<li>I know that the first argument is important in pipe-friendly functions. But I ignore if the second and other arguments play a role or not.</li>
<li>Do people use the ellipsis (<code>...</code>) argument in pipe-friendly functions? With my <em><a rel="nofollow" href="http://bioconductor.org/packages/derfinder" target="_blank">derfinder</a></em> package I ended up a very deep rabbit hole using <code>...</code>. I explained some of the logic in my <code>dots</code> <a rel="nofollow" href="http://lcolladotor.github.io/2014/12/11/dots/#.WuO4-VMvy50" target="_blank">blog post</a> (there are fair criticisms to going deep with <code>...</code> in the comments).</li>
<li>How do you write unit tests for pipe-friendly functions? Similar to how you write documentation for them, do the unit tests just test one function a time or do they test several at a time (that is the output after using <code>%>%</code>)?</li>
</ul>
<p>These and other questions could involve time getting familiar with. Time that I could spend now, before unconf18, learning and at least getting a better sense of what to expect. Maybe I’m complicating myself and worrying too much about this. I imagine that the solution will involve a combination of:</p>
<ul>
<li>Checking some popular tidyverse packages that use <code>%>%</code>. Like the vignettes/README files and examples.</li>
<li>Reading more about this in a book(s): I don’t know which one though.</li>
<li>Playing around a bit as a user with some of these functions. See what error messages pop up: actually I don’t know how users debug a series of functions tied together via <code>%>%</code>.</li>
</ul>
</div>
<div>
<h3>Wrapping up</h3>
<p>I’m not saying everyone should learn about these topics before unconf18. I think that we are all (well, maybe excluding some) worried about not knowing <span>\(X\)</span> or <span>\(Y\)</span> <code>R</code>/<code>git</code>/<code>travis</code>/<code>testthat</code>/<code>usethis</code>/etc topic before unconf18. And that will part of why it’ll be great to meet everyone in what is known to be an extremely welcoming R conference ^^ (seriously, check <a rel="nofollow" href="https://ropensci.org/blog/2017/06/02/unconf2017/" target="_blank">all the unconf17 posts</a>!).</p>
<pre><code>## And I'm done proofreading the post. Yay!
Sys.time()</code></pre>
<pre><code>## [1] &quot;2018-04-27 20:24:12 EDT&quot;</code></pre>
</div>
<div>
<h3>Acknowledgements</h3>
<p>This blog post was made possible thanks to:</p>
<ul>
<li><em><a rel="nofollow" href="http://bioconductor.org/packages/BiocStyle" target="_blank">BiocStyle</a></em> <a></a>(<a rel="nofollow" href="https://github.com/Bioconductor/BiocStyle" target="_blank">Oleś, Morgan, and Huber, 2018</a>)</li>
<li><em><a rel="nofollow" href="https://cran.r-project.org/package=blogdown" target="_blank">blogdown</a></em> <a></a>(<a rel="nofollow" href="https://github.com/rstudio/blogdown" target="_blank">Xie, Hill, and Thomas, 2017</a>)</li>
<li><em><a rel="nofollow" href="https://cran.r-project.org/package=devtools" target="_blank">devtools</a></em> <a></a>(<a rel="nofollow" href="https://cran.r-project.org/package=devtools" target="_blank">Wickham, Hester, and Chang, 2018</a>)</li>
<li><em><a rel="nofollow" href="https://cran.r-project.org/package=knitcitations" target="_blank">knitcitations</a></em> <a></a>(<a rel="nofollow" href="https://cran.r-project.org/package=knitcitations" target="_blank">Boettiger, 2017</a>)</li>
</ul>
</div>
<div>
<h3>References</h3>
<p>
<a></a><a rel="nofollow" href="http://feedproxy.google.com/~r/FellgernonBit-rstats/~3/PbdtvPZc_s4/#cite-Boettiger_2017" target="_blank">[1]</a><cite> C. Boettiger. <em>knitcitations: Citations for ‘Knitr’ Markdown Files</em>. R package version 1.0.8. 2017. URL: <a rel="nofollow" href="https://cran.r-project.org/package=knitcitations" target="_blank">https://CRAN.R-project.org/package=knitcitations</a>.</cite>
</p>
<p>
<a></a><a rel="nofollow" href="http://feedproxy.google.com/~r/FellgernonBit-rstats/~3/PbdtvPZc_s4/#cite-Oles_2018" target="_blank">[2]</a><cite> A. Oleś, M. Morgan and W. Huber. <em>BiocStyle: Standard styles for vignettes and other Bioconductor documents</em>. R package version 2.7.9. 2018. URL: <a rel="nofollow" href="https://github.com/Bioconductor/BiocStyle" target="_blank">https://github.com/Bioconductor/BiocStyle</a>.</cite>
</p>
<p>
<a></a><a rel="nofollow" href="http://feedproxy.google.com/~r/FellgernonBit-rstats/~3/PbdtvPZc_s4/#cite-Wickham_2018" target="_blank">[3]</a><cite> H. Wickham, J. Hester and W. Chang. <em>devtools: Tools to Make Developing R Packages Easier</em>. R package version 1.13.5. 2018. URL: <a rel="nofollow" href="https://cran.r-project.org/package=devtools" target="_blank">https://CRAN.R-project.org/package=devtools</a>.</cite>
</p>
<p>
<a></a><a rel="nofollow" href="http://feedproxy.google.com/~r/FellgernonBit-rstats/~3/PbdtvPZc_s4/#cite-Xie_2017" target="_blank">[4]</a><cite> Y. Xie, A. P. Hill and A. Thomas. <em>blogdown: Creating Websites with R Markdown</em>. ISBN 978-0815363729. Boca Raton, Florida: Chapman and Hall/CRC, 2017. URL: <a rel="nofollow" href="https://github.com/rstudio/blogdown" target="_blank">https://github.com/rstudio/blogdown</a>.</cite>
</p>
</div>
<div>
<h3>Reproducibility</h3>
<pre><code>## Session info ----------------------------------------------------------------------------------------------------------</code></pre>
<pre><code>##  setting  value                                             
##  version  R Under development (unstable) (2017-11-29 r73789)
##  system   x86_64, darwin15.6.0                              
##  ui       X11                                               
##  language (EN)                                              
##  collate  en_US.UTF-8                                       
##  tz       America/New_York                                  
##  date     2018-04-27</code></pre>
<pre><code>## Packages --------------------------------------------------------------------------------------------------------------</code></pre>
<pre><code>##  package       * version date       source                            
##  backports       1.1.2   2017-12-13 CRAN (R 3.5.0)                    
##  base          * 3.5.0   2017-11-29 local                             
##  bibtex          0.4.2   2017-06-30 CRAN (R 3.5.0)                    
##  BiocStyle     * 2.7.9   2018-04-27 Bioconductor                      
##  blogdown        0.6     2018-04-18 CRAN (R 3.5.0)                    
##  bookdown        0.7     2018-02-18 CRAN (R 3.5.0)                    
##  colorout      * 1.1-3   2017-11-29 Github (jalvesaq/colorout@e2a175c)
##  compiler        3.5.0   2017-11-29 local                             
##  datasets      * 3.5.0   2017-11-29 local                             
##  devtools      * 1.13.5  2018-02-18 CRAN (R 3.5.0)                    
##  digest          0.6.15  2018-01-28 CRAN (R 3.5.0)                    
##  evaluate        0.10.1  2017-06-24 CRAN (R 3.5.0)                    
##  graphics      * 3.5.0   2017-11-29 local                             
##  grDevices     * 3.5.0   2017-11-29 local                             
##  htmltools       0.3.6   2017-04-28 CRAN (R 3.5.0)                    
##  httr            1.3.1   2017-08-20 CRAN (R 3.5.0)                    
##  jsonlite        1.5     2017-06-01 CRAN (R 3.5.0)                    
##  knitcitations * 1.0.8   2017-07-04 CRAN (R 3.5.0)                    
##  knitr           1.20    2018-02-20 CRAN (R 3.5.0)                    
##  lubridate       1.7.4   2018-04-11 CRAN (R 3.5.0)                    
##  magrittr        1.5     2014-11-22 CRAN (R 3.5.0)                    
##  memoise         1.1.0   2017-04-21 CRAN (R 3.5.0)                    
##  methods       * 3.5.0   2017-11-29 local                             
##  plyr            1.8.4   2016-06-08 CRAN (R 3.5.0)                    
##  R6              2.2.2   2017-06-17 CRAN (R 3.5.0)                    
##  Rcpp            0.12.16 2018-03-13 CRAN (R 3.5.0)                    
##  RefManageR      1.2.0   2018-04-25 CRAN (R 3.5.0)                    
##  rmarkdown       1.9     2018-03-01 CRAN (R 3.5.0)                    
##  rprojroot       1.3-2   2018-01-03 CRAN (R 3.5.0)                    
##  stats         * 3.5.0   2017-11-29 local                             
##  stringi         1.1.7   2018-03-12 CRAN (R 3.5.0)                    
##  stringr         1.3.0   2018-02-19 CRAN (R 3.5.0)                    
##  tools           3.5.0   2017-11-29 local                             
##  utils         * 3.5.0   2017-11-29 local                             
##  withr           2.1.2   2018-03-15 CRAN (R 3.5.0)                    
##  xfun            0.1     2018-01-22 CRAN (R 3.5.0)                    
##  xml2            1.2.0   2018-01-24 CRAN (R 3.5.0)                    
##  yaml            2.1.18  2018-03-08 CRAN (R 3.5.0)</code></pre>
</div>
<div>
<hr>
<ol>
<li>
<p>Feeling welcomed can be hard… oh well.<a rel="nofollow" href="http://feedproxy.google.com/~r/FellgernonBit-rstats/~3/PbdtvPZc_s4/#fnref1" target="_blank"><img alt="↩" src="https://s.w.org/images/core/emoji/2.4/72x72/21a9.png" class="wp-smiley"></a></p>
</li>
<li>
<p>We could talk about git for a long time too. But I hope that I’ll get by with some git push, git pull, and maybe git branch.<a rel="nofollow" href="http://feedproxy.google.com/~r/FellgernonBit-rstats/~3/PbdtvPZc_s4/#fnref2" target="_blank"><img alt="↩" src="https://s.w.org/images/core/emoji/2.4/72x72/21a9.png" class="wp-smiley"></a></p>
</li>
<li>
<p>It’s one of the sponsors <a rel="nofollow" href="http://unconf18.ropensci.org/#sponsors" target="_blank">http://unconf18.ropensci.org/#sponsors</a> and well, probably want most will be using since it has such nice tools for writing R packages.<a rel="nofollow" href="http://feedproxy.google.com/~r/FellgernonBit-rstats/~3/PbdtvPZc_s4/#fnref3" target="_blank"><img alt="↩" src="https://s.w.org/images/core/emoji/2.4/72x72/21a9.png" class="wp-smiley"></a></p>
</li>
<li>
<p>Specially since most only attend one unconf, I think. So it’s different from other conferences that you can experience multiple years and network with the group across a longer period of time: that’s what I’ve done with the Bioconductor meetings.<a rel="nofollow" href="http://feedproxy.google.com/~r/FellgernonBit-rstats/~3/PbdtvPZc_s4/#fnref4" target="_blank"><img alt="↩" src="https://s.w.org/images/core/emoji/2.4/72x72/21a9.png" class="wp-smiley"></a></p>
</li>
</ol>
</div>
<p><img width="1" alt="" src="http://feeds.feedburner.com/~r/FellgernonBit-rstats/~4/PbdtvPZc_s4" height="1"></p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://feedproxy.google.com/~r/FellgernonBit-rstats/~3/PbdtvPZc_s4/"> Fellgernon Bit - rstats</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/b7klsUZ-CQA" height="1"></a></div>