<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/rsurvey/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://jfisher-usgs.github.io/r/2017/02/27/rsurvey"> jfisher-usgs</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>Early in my science career I believed that any good piece of software included a graphical user interface (GUI).<br>
That was many years ago, and during that time I delved deep into the art of <a target="_blank" rel="nofollow" href="https://tcl.tk/">Tcl/Tk</a> programming;<br>
using the <strong>tcltk</strong> package to create GUI’s in <a target="_blank" rel="nofollow" href="https://www.r-project.org/">R</a>.<br>
Countless hours were spent struggling over the R-Tcl/Tk interface and educating myself on the best practices and principles for GUI design.<br>
After a few years of toil, I finally started feeling proficient with GUI construction.<br>
It was around this time that I also became aware of the importance of reproducible research;<br>
thanks to the many discussions on the topic within the R community.<br>
Rather quickly my GUI development ceased, and all of the GUI-based applications<br>
I relied so heavily on for my research (such as Excel, ArcGIS, and Illustrator) were no longer relevant.<br>
Scripting has become the essential ingredient for making my research reproducible,<br>
and I believe my work has benefited immensely from taking this approach.</p>
<p>More recently I’ve become a bit of a zealot about preaching the importance of reproducibility to my fellow scientists.<br>
These are career researchers in the earth sciences,<br>
typically with little to no programming experience—smart individuals on a strictly GUI-based diet.<br>
I’m disappointed to report that my efforts have resulted in very few converts.<br>
My colleagues have gone through a couple of R-training workshops,<br>
been made aware of countless online materials for learning to code, and are still having difficulties crossing over.<br>
The biggest complaint I here is that the learning curve is just too steep.<br>
And I get it, learning your first programming language can be extremely difficult,<br>
especially when you’re trying to meet publication deadlines.</p>
<p>This may come as blasphemy to some, but perhaps the best way to reach out to these folks is through R-GUI applications<br>
(such as <a target="_blank" rel="nofollow" href="http://www.rcommander.com/">R Commander</a>).<br>
Start them with the familiar and let these gateway applications slowly get them hooked on R.<br>
Reasoning such as this have spurred me to dust off one of my old R GUI’s,<br>
<strong>RSurvey</strong>, a cross-platform geographic information system (GIS) application.<br>
Perhaps not as feature rich as other GIS applications (such as <a target="_blank" rel="nofollow" href="http://www.qgis.org/">QGIS</a>),<br>
but completely written in R and fairly simple to use.<br>
The package repository is located on <a target="_blank" rel="nofollow" href="https://github.com/USGS-R/RSurvey">GitHub</a>.</p>
<p>To install the stable version of <strong>RSurvey</strong> from <a target="_blank" rel="nofollow" href="https://cran.r-project.org/package=RSurvey">CRAN</a>,<br>
open an R session and type the following command</p>
<div>
<pre><code><span>install.packages</span><span>(</span><span>&quot;RSurvey&quot;</span><span>)</span><span>
</span></code></pre>
</div>
<p>If you’re running into difficulties with package installation, see the package<br>
<a target="_blank" rel="nofollow" href="https://github.com/USGS-R/RSurvey/blob/master/README.md">README</a> file for possible solutions.<br>
To load the package and launch the main GUI, use the command</p>
<div>
<pre><code><span>library</span><span>(</span><span>&quot;RSurvey&quot;</span><span>)</span><span>
</span></code></pre>
</div>
<p>If any of the suggested packages are missing, you will be prompted to install them when it first starts up.<br>
The main GUI should look something like this</p>
<p><img alt="center" src="https://i2.wp.com/jfisher-usgs.github.io/figs/2017-02-27-rsurvey/fig1-gui.png?w=456" data-recalc-dims="1"></p>
<p>No manual currently exists for the <strong>RSurvey</strong> package; its absence is mainly attributed to the authors laziness;<br>
but also from a sense that the software should reach a certain level of maturity before embarking on such an endeavor,<br>
thus avoiding endless document revisions.<br>
That said, please keep in mind that considerable effort was put into making the user interface easy enough to use without instruction.</p>
<p>In the remainder of this post, windows are shown for a typical <strong>RSurvey</strong> session that includes<br>
data import, data wrangling, and data visualization.<br>
This example session illustrates only a small fraction of the package’s functionality.<br>
You’ll need to explore the package on your own to discover its full potential.<br>
Any comments/guidance would be greatly appreciated, you can contact me via <a target="_blank" rel="nofollow" href="http://jfisher-usgs.github.io/r/2017/02/27/jfisher@usgs.gov">email</a>.<br>
Bug reports and feature requests can be submitted on the GitHub<br>
<a target="_blank" rel="nofollow" href="https://github.com/USGS-R/RSurvey/issues">Issues page</a>.</p>
<p><img alt="center" src="https://i0.wp.com/jfisher-usgs.github.io/figs/2017-02-27-rsurvey/fig2-import.png?w=456" data-recalc-dims="1"></p>
<p><img alt="center" src="https://i1.wp.com/jfisher-usgs.github.io/figs/2017-02-27-rsurvey/fig3-editor.png?w=456" data-recalc-dims="1"></p>
<p><img alt="center" src="https://i0.wp.com/jfisher-usgs.github.io/figs/2017-02-27-rsurvey/fig4-variables.png?w=456" data-recalc-dims="1"></p>
<p><img alt="center" src="https://i1.wp.com/jfisher-usgs.github.io/figs/2017-02-27-rsurvey/fig5-polygon.png?w=456" data-recalc-dims="1"></p>
<p><img alt="center" src="https://i2.wp.com/jfisher-usgs.github.io/figs/2017-02-27-rsurvey/fig6-plot2d.png?w=456" data-recalc-dims="1"></p>
<p><img alt="center" src="https://i0.wp.com/jfisher-usgs.github.io/figs/2017-02-27-rsurvey/fig7-plot3d.png?w=456" data-recalc-dims="1"></p>
<p>And let’s not forget the R session information.</p>
<div>
<pre><code><span>devtools</span><span>::</span><span>session_info</span><span>()</span><span>
</span><span>## Session info ------------------------------------
## setting value
## version R version 3.3.2 (2016-10-31)
## system x86_64, mingw32
## ui Rgui
## language (EN)
## collate English_United States.1252
## tz America/Los_Angeles
## date 2017-02-24
##
## Packages ----------------------------------------
## package * version date source
## devtools 1.12.0 2016-06-24 CRAN (R 3.3.2)
## digest 0.6.12 2017-01-27 CRAN (R 3.3.2)
## htmltools 0.3.5 2016-03-21 CRAN (R 3.3.2)
## htmlwidgets 0.8 2016-11-09 CRAN (R 3.3.2)
## httpuv 1.3.3 2015-08-04 CRAN (R 3.3.2)
## jsonlite 1.2 2016-12-31 CRAN (R 3.3.2)
## knitr 1.15.1 2016-11-22 CRAN (R 3.3.2)
## magrittr 1.5 2014-11-22 CRAN (R 3.3.2)
## memoise 1.0.0 2016-01-29 CRAN (R 3.3.2)
## mime 0.5 2016-07-07 CRAN (R 3.3.2)
## R6 2.2.0 2016-10-05 CRAN (R 3.3.2)
## Rcpp 0.12.9 2017-01-14 CRAN (R 3.3.2)
## rgl 0.97.0 2017-01-10 CRAN (R 3.3.2)
## RSurvey * 0.9.1 2017-02-24 CRAN (R 3.3.2)
## shiny 1.0.0 2017-01-12 CRAN (R 3.3.2)
## withr 1.0.2 2016-06-20 CRAN (R 3.3.2)
## XML 3.98-1.5 2016-11-10 CRAN (R 3.3.2)
## xtable 1.8-2 2016-02-05 CRAN (R 3.3.2)
</span></code></pre>
</div>
<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://jfisher-usgs.github.io/r/2017/02/27/rsurvey"> jfisher-usgs</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 title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/QW7ta2w2KGI"></a></div>