R/Interactive Plots

From QERM Wiki
(Difference between revisions)
Jump to: navigation, search
Cole (Talk | contribs)
(Started the page with a few examples)
Newer edit →

Revision as of 17:06, 6 June 2012

Contents

The Manipulate Package

This package is specific to RStudio and is a quick way to provide the ability to interact with R using a simple GUI. You can put sliders, checkboxes, pickers or buttons on parameters which are then fed back into your function. It is surprisingly easy to get up and running, but I have really only found this useful for plots. It can be a great way to familiarize yourself with a new model, or as an instructional tool.

See the help file for manipulate for more information.

Examples

I wrote some interactive plots for lab sessions in FISH 458 and QERM 514 and thought I would share them out.

ANCOVA

A simple example to help show the relationship between the parameters in a model with 1 continuous and 1 categorical variable. Rlogo.jpg ANCOVA

ANCOVA.png

Beta Binomial

A classic example for teaching Bayesian statistics. Beta prior on a binomial probability parameter. Rlogo.jpg Beta Binomial

BetaBinomial example.png

Predator-Prey System

This is straight from a 458 lab where we were examining the relationship between lions and Wildebeest. The first plot are the population sizes over time, and the second is the phase plane with a smoothly shifting color scheme to show the magnitude of change at the time steps. The big idea here is what happens as density dependence is added (this is the “c” parameter”) to the Wildebeest population. Apologies for the poorly named variables and lack of comments. Rlogo.jpg Predator Prey

PredatorPrey.png
Personal tools