R Studio and Shiny

R Studio has released a web application that is run (nearly) entirely through R (R Studio). It’s called Shiny and it’s great! It easily lets you turn your R scripts into a webpage. This is great for teaching purposes, showing off some code, and publishing to the web.

R Studio has given its users everything they need to make a web app using templates they have provided.  Everything fits into one “.R” file for easy editing and publishing.

You can find the Shiny page here: http://shiny.rstudio.com/

Here’s a link to my Shiny app. This has 4 statistical distributions (normal, lognormal, weibull, exponential) and let’s the user interact with the variables. The box plot and histogram of the data respond to the user controlled inputs.

Check it out here: My Shiny App
(Make sure to give it about 30 seconds to fully load for the first time.)

screenshot

Advertisements

Unbroken – A Visual Guide via Google Earth

I recently finished reading Unbroken by Laura Hillenbrand. It was an immensely powerful story of the human spirit and will to survive and flourish. The only thing I felt was lacking in the book was a visual guide (i.e., map) of Louie’s crazy trip around the Pacific. Therefore I made this Google Earth kmz file which has pins for many of the significant locations in the book once Louie is sent to Honolulu. The kmz file can be viewed in Google Maps by clicking the link, with the option to download if interested (see link below). Here’s a list of the locations included:

KMZ Download (via google drive)

Honolulu
Midway Islands
Wake Atoll
Canton Island
Makin – Gilbert Islands
Tarawa – Gilbert Islands
Funafuti
Nauru
Palmyra Atoll
Flight path of the Green Hornet
Lost at Sea – Louie, Phil and Mac’s drifting journey
Wotje Atoll
Kwajalein Atoll – Execution Island
Ofuna Camp (very approximate)
Omori POW Camp
Naoetsu POW Camp

R Studio Update!

R Studio currently has version 0.99.442 out for download. I highly recommend upgrading to the latest version since there has been a lot of new functionality added. Here’s a few snapshots of some of the new features:

There’s built-in debugging icons within R scripts to the left of the line number. For this feature to work properly your script has to be saved (e.g., test.R).

Capture1

When I hover my mouse over the error I see the message “unexpected token ‘)’ “, which is letting me know I have an extra closed parenthesis. Sweet!

Capture1b

There’s built-in auto-fill for some of the parameters you may be adding to a function. In the image below I’m starting to add ‘xlim’ to specify the x-axis limits of my plot. My full coding might be something like “xlim = c(0, 6)”. Click the image below for a bigger picture so you can read the dialog box.

Capture2

In the image below, I’m calling the function lm (for linear regression), but I have a comma without another argument. When I hover the mouse over the yellow triangle exclamation point the built-in debugging says there’s a “missing argument to function call”. This Is AWESOME!!!

Capture3

These are just a few of the new features in R Studio. Get out there and check it out!!!