R

Multivariate Analysis with R

Preliminaries Multivariate data A map Distance matrices Cluster analysis Mantel test Multidimensional scaling Principal components analysis Discriminant function analysis Epilogue Reading time: 32 minute(s) @ 200 WPM. Preliminaries At some time or another, most users of statistics find themselves sitting in front of a large pile of computer output with the realization that it tells them nothing that they really want to know.

An Introduction to R

Prologue Getting a feel for R The console Function calls and arguments HINT: Getting help Some graphics HINT: Command history and workspace Getting data into R Data frames Creating data frames HINT: Data management in R and RStudio. Exploratory data analysis Scatterplot matrix HINT: R packages Summary statistics and data screening Box plots Stem-and-leaf display Categorical variables: factors Some confirmatory analysis More graphics R scripts (command files) An R menu system: R-commander Epilogue Reading time: 22 minute(s) @ 200 WPM.

How I Deploy My Website to GitHub Using RStudio, blogdown, and Hugo

Reading time: 3 minute(s) @ 200 WPM. I have worked for days trying to get this website up and running on GitHub Pages. I think I finally have gotten it to work. This is that story. I have studied the following sources of punditage: Making a Website Using Blogdown, Hugo, and GitHub pages Update: Deploying Hugo-generated websites on personal GitHub Pages How to make a GitHub pages blog with RStudio and Hugo Including image using blogdown Building a Blog with Blogdown and GitHub The Hugo documentation Create Blogs and Websites with R Markdown Hosting on GitHub Pages Build_Site and Serve_Site Output Issues Create a Free Personal Academic Website with Hugo All of the articles and discussions were enlightening, and helped me arrive at what I believe to be the simplest way to deploy a Hugo-generated website on GitHub Pages, at least for me.

An R script for calculating the reading time of an R Markdown file

Reading time: 2 minute(s) @ 200 WPM. To see how we just did that, read on. Because psychological research tells us that including estimated reading times can increase reader engagement with digital content, I decided to include reading times for my riveting posts. So I wrote a simple R script. Here it is, as an R code chunk: ```{r echo=FALSE} bytes The script is very simple, such that even I could program it.

Musings on blogdown and Hugo

Reading time: 4 minute(s) @ 200 WPM. I am a huge fan of R and RStudio, especially relative to their use in creating reproducible research (see RStudio as a Research and Writing Platform). I was thus thrilled to learn that a new R package, blogdown, was being developed for producing websites from R Markdown files using RStudio and the static website generator, Hugo. This website was built and is maintained using blogdown and Hugo running inside of RStudio, and is hosted on GitHub Pages.

R Markdown Test

Reading time: 2 minute(s) @ 200 WPM. Yes, it doth work. The blogdown package can nicely deal with R Markdown containing embedded R code for production of statistical analyses and graphics. But. It cannot deal with R Notebooks, which contain a special flavor of R Markdown allowing for interactive display of R code alongside the results they produce. R Notebooks, when rendered into HTML, produce a special file named *.

Video test

Reading time: 1 minute(s) @ 200 WPM. We now attempt to insert into our R Markdown file, which Hugo then renders into HTML, an mp4 video of dragonflies (insect order Odonata, in case you’re wondering) that were congregating in my front yard a few summers ago. So I’m thinking, just insert it using a regular Markdown image tag, yes? Like this: ![](/mp4/Dragonflies.mp4). And so, that worked. To center this video on the page I am using the deprecated HTML <center> tag inside of my R Markdown.

Making Maps with R

Making maps on a computer has traditionally required the use of desktop geographic information system (GIS) software such as ArcGIS or QGIS. An alternative is to use R, a free software environment for statistical computing and graphics. R has many features that allow it to read GIS data and produce both static and interactive maps. This document (which is an R Notebook) shows how to make maps with R and RStudio, using R base graphics and the maps and mapdata packages, in addition to the leaflet and tmap packages.

Habitat structure and phenotypic variation in the invading butterfly Coenonympha tullia

The R Notebook Habitat structure and phenotypic variation in the invading butterfly Coenonympha tullia is a mockup of a scientific paper (although the field data are real) to illustrate the use of R Notebooks as a means of creating reproducible research. The objective is to produce publication-quality output, in HTML, PDF, and Microsoft Word formats, with text, literature citations, a formatted bibliography, statistical analyses, tables, and graphics, all from one, plain-text R Notebook.

RStudio as a Research and Writing Platform

Reproducible Research Software Installation Rendering Documents in RStudio Writing and Citing in RStudio R Notebooks Reproducible Research Revisited Coda I: Python Coda II: Inspirational Quotes About Data Reading time: 22 minute(s) @ 200 WPM. R (r-project.org) is a programming language and software platform for statistical computing and graphics, widely used in academia and industry (see An Introduction to R). RStudio is an integrated development environment for R.

Getting images to work

Reading time: 3 minute(s) @ 200 WPM. I was until very recently involved in an epic struggle to get the system described in Making a Website Using Blogdown, Hugo, and GitHub pages to work for me. (See also Building a Blog with Blogdown and GitHub.) I really want it to work, because it has produced the current website that you are now reading, and I’m sure you’ll agree that it is very, very beautiful, in a stark, post-apocalyptic, Mordor-esque sort of way.

Time stamp issue

There seems to be a bug in blogdown in which time stamps for posts are all 00:00. Either that or there is something in some setting somewheres that I am missing. If we use the blogdown “New Post” RStudio addin, the time stamp for the post is 00:00. However, if we create a post using the blogdown new_post() function, the time stamp is correct. This either needs to be fixed or I need to be re-educated.

First post

This site is written, built, and maintained in RStudio using the R blogdown package and the Hugo static website generator. See Making a Website Using Blogdown, Hugo, and GitHub. An apparent quirk (or maybe it’s a feature) of this system is that hyperlinks are not displayed in the short summary displayed by default for each post. The summary consists simply of the first n lines of the posts’s text, where the variable n has a value that is unknown to me.