rstats

Handling Time Series Data with Rolling Averages

Introduction When looking at time series data it can be useful to consolidate high frequency data into lower frequency increments. At first this sounds contradictory to common practice, after all isn’t more data always better? It turns out this isn’t always the case and this can be where a rolling average (also known as a moving average) can be helpful. To note, this tutorial will only cover use cases where time series values are of interest.

United States Gun Violence

Creating a dashboard to look into gun violence in the U.S.

Refreshing the Resume

Using RMarkdown to Generate Your Resume

Building Shiny Apps with Rvest

Creating a Shiny application to scrape data from IMDB's top movies.

RMarkdown Workshop

An approachable, interactive tutorial workshop for new users of R, RStudio, and RMarkdown using real world health data.

RMarkdown Tips and Tricks

An Introduction to RMarkdown Welcome to the first RMarkdown tutorial! We will be discussing some basic tips and tricks to interface with an RMarkdown document with concepts ranging from beginner to intermediate. In this tutorial I assume you have some base level understanding of R, RStudio, and an awareness of Markdown language. For a comprehensive list of functionality in RMarkdown, please refer to the RStudio cheat sheet. Creating your RMarkdown file can be done by selecting “File” at the top of RStudio navigator then “New File” > “RMarkdown…”, which will prompt you with an intial interface like this one:

The Spreadsheet Betrayal - ARCUS at CHOP

The pros and cons of the spreadsheet

Importing XLSX and CSV into R

Incorporating spreadsheets into your R workflow.

Animations with gganimate

Today I’m going to show a brief walkthrough on using Thomas Lin Pedersen’s gganimate package, a great tool for greating GIFs of data for easy sharing. Check out his GIT repo for a full overview. This example uses mock patient ART line data to reconstruct a live QRS complex. While some of this may sound unfamiliar, the image below is pretty familiar to anyone who has watched a hospital drama show:

Plotting with ggplot2

For beginners just getting their bearings in R and Rstudio, there are a few quick ways to translate your data into visualization. Let’s start with some random sample data with an exponential behavior: The Plot Command set.seed(123) x <- rnorm(100,10,1) y <- exp(x) plot(x,y, main = "A Sample Plot", xlab = "X-label", ylab = "Y-label") Behold…ggplot2! The plot command is a quick way to snapshot your data in a bare-bones manner.