class: left, bottom background-image: url("images/contour.png") background-position: right background-size: auto # The R Environment ### Installation & Environment Configuration <p> </p> <p> </p> <img src="images/logo1.svg" width="400px"> --- class: sectionTitle # Software --- # Analytical Platforms - Old School .pull-left[ - Mastery required *a priori* - Limitless (mostly) - Steep learning curve ] .pull-right[ ![Blackboard](images/board.png) ] --- # Analytical Platforms - Point & Click .pull-left[ - Mastery through discovery (*what does this do? - Only supporting the most common implementations - Expansion boundaries - Tied to closed-source corporation ] .pull-right[ ![Blackboard](images/mouse.png) ] --- # Analytical Platforms - Analytical Languages .pull-left[ - Generalized Tools - Expandable by the User - Lower "barrier to entry" - Useful across many domains. ] .pull-right[ ![Blackboard](images/rstudio.png) ] --- class: sectionTitle # Why Analytical Languages --- class: center middle ![R Julia Python](images/R_Julia_Python.png) --- # It all started... > Date: Wed, 4 Aug 93 14:01:31 NZS > From: Ross Ihaka > To: S-news@utstat.toronto.edu > Subject: Re: Is S available for a Macintosh personal computer? > > Joseph B Kruskal writes: > > > If anyone knows of an S available for a Macintosh computer, I > would be pleased to hear about it. > > About a year ago Robert Gentleman and I considered the problem of > obtaining decent statistical software for our undergraduate > Macintosh lab. After considering the options, we decided that > the most satisfactory alternative was to write our own. We > started by writing a small lisp interpreter. Next we expanded > its data structures with atomic vector types and altered its > evaluation semantics to include lazy evaluation of closure > arguments and argument binding by tag as well as order. Finally > we added some syntactic sugar to make it look somewhat like S. > We call the result "R". --- class: center middle <img src="slides_files/figure-html/unnamed-chunk-1-1.png" width="504" /> --- # Community Input `R` is designed to be extensible. This means that as people tackle different problems, they provide code solutions that others may also freely use. .center[ <iframe src="https://cran.r-project.org/web/packages/available_packages_by_name.html" title="Packages available for R" width=700 height=400> </iframe> ] --- class: center middle ![Data Analyses Manuscripts](images/data-analysis-manuscript.png) --- class: middle, center
--- # Data & Narrative The spatial distribution of `\(N =\)` 1408 individuals were sampled from `\(K =\)` 29 sampling sites covering the entire known extent for *Araptus attenuatus* (Figure \ref{fig-sampling}). The observed sex ratio (Females:Males) within each of the sampling locales varied considerably, ranging from a low of 0.455 to 1.68. -- Female beetles seem to be selecting locales in more suitable habitats (Figure \ref{fig-habitat}), which is consistent with a Gaussian log normal distribution (GLM; intercept = 0.836; coef =-0.216; P =0.0288; Figure \ref{fig-glm}). This suggests that males who establish brood chambers at the margins of the species niche are actively selected against by maturing females. --- class: center middle
--- class: center middle <img src="slides_files/figure-html/unnamed-chunk-5-1.png" width="504" /> --- # Getting R The canonical location for R is [CRAN](https://cran.r-project.org), which is the main site but has [mirrors](https://cran.r-project.org/mirrors.html) sites located across the world. - Pick a site in close geospatial proximity to you. - Download the installer for your platform (Mac, Windows, Linux) - Follow the instructions on the installer for your particular platform. --- # Sufficent R Version? If you already have R installed on your computer, you may want to make sure it is up-to-date. The last time these slides were compiled (they are written in R as well), the version was: ```r version$version.string ``` ``` ## [1] "R version 4.0.3 (2020-10-10)" ``` To ensure you are able to complete all the activites in this class, please have at least this version on your computer. --- # Keeping Updated If you have a relatively recent version, we can make sure that the packages you already have are also updated by giving the following command. ```r update.packages(ask=FALSE) ``` --- class: center middle # The Native `R` Interface ![R.app](images/R.app.png) --- class: center middle # R Via Terminal ![R Terminal](images/R_Terminal.png) --- class: sectionTitle # RStudio --- # RStudio [RStudio.com](https://rstudio.com) --- # Using RStudio Cloud [RStudio.cloud](https://rstudio.cloud) --- class: center middle ![Cloud pricing](images/rstudio.cloud.png) --- # Tour of the Interface RStudio is essentially a 4-paned browser. --- class: middle background-image: url("images/contour.png") background-position: right background-size: auto .center[ # Questions? ![Peter Sellers](images/peter_sellers.gif) ] <p> </p> .bottom[ If you have any questions for about the content presented herein, please feel free to [submit them to me](https://docs.google.com/forms/d/e/1FAIpQLScrAGM5Zl8vZTPqV8DVSnSrf_5enypyp0717jG4PZiTlVHDjQ/viewform?usp=sf_link) and I'll get back to you as soon as possible.]