Skip to content

Instantly share code, notes, and snippets.

View trestletech's full-sized avatar

Jeff Allen trestletech

View GitHub Profile
@trestletech
trestletech / Vagrantfile
Last active September 24, 2019 20:49
Ubuntu 18.04 Vagrantfile with RStudio Desktop installed and arbitrary version of R (via r-builds). user/pass is `vagrant:vagrant`
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
#
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
@trestletech
trestletech / .gitignore
Last active March 3, 2019 04:05
Categorize mint.com transactions. Transactions can be exported from Mint and reprocessed in R.
.Rproj.user
.Rhistory
.RData
transactions/
budgets/
@trestletech
trestletech / README.md
Last active October 3, 2018 10:16
Shiny Example #3 for Bioconductor.

Bioconductor Shiny Example #3

Simple app showing the relationship between a gene's expression and survival.

This is an example Shiny app featuring some basic analysis of Ovarian Cancer gene expression data collected on the Affymetrix U133A platform. We filter the available genes and samples down to a much smaller matrix to make reproducibility simpler for a broader audience. The R code involved in sampling the data is available in this Gist as an R-Markdown file, and the sampled data are available in this Gist as Rds files.

To run the application, install shiny (install.packages("shiny")) then run the following command:

library(shiny)

@trestletech
trestletech / server.R
Last active June 29, 2018 19:01
An example using a SelectInput element in Shiny to render a plot. Using a sidebar layout and the 'WorldPhones' dataset.
library(shiny)
# Rely on the 'WorldPhones' dataset in the datasets
# package (which generally comes preloaded).
library(datasets)
# Define a server for the Shiny app
shinyServer(function(input, output) {
# Fill in the spot we created for a plot

Keybase proof

I hereby claim:

  • I am trestletech on github.
  • I am trestletech (https://keybase.io/trestletech) on keybase.
  • I have a public key whose fingerprint is DC6E 66E5 1FD7 E7DD 48F3 30DC F444 9D7D 7C8B 4C37

To claim this, I am signing this object:

@trestletech
trestletech / analysis.R
Last active July 7, 2017 16:49
Tidying of pressure-sensitive keystroke dynamics data. Raw available: https://figshare.com/articles/Pressure-sensitive_keystroke_dynamics_data/5170705 . The `isJA` column represents whether or not the user currently typing is "Jeffrey Allen" -- i.e. is the user typing his own name (TRUE) or someone else's (FALSE)?
download.file("https://ndownloader.figshare.com/articles/5170705/versions/1", "kd.zip")
unzip("kd.zip")
library(readr)
words <- readr::read_csv("KSP-Word.csv")
users <- readr::read_csv("KSP-User.csv")
entries <- readr::read_csv("KSP-Entry.csv")
keypress <- readr::read_csv("KSP-KeyPress.csv")
pressure <- readr::read_csv("KSP-Pressure.csv")
@trestletech
trestletech / global.R
Last active May 30, 2017 10:44 — forked from jpd527/server.R
sortListInput <- function(inputId,data) {
tagList(
singleton(tags$head(tags$script(src = "js/sortList.js"))),
HTML(paste('
<script>
$(function() {
$( ".sortableList" ).sortable();
$( ".sortableList" ).disableSelection();
});
@trestletech
trestletech / server.R
Last active May 25, 2017 21:30
An example of doing prolonged, iterative computation in Shiny.
library(shiny)
shinyServer(function(input, output, session) {
# The number of iterations to perform
maxIter <- 50
# Track the start and elapsed time
startTime <- Sys.time()
output$elapsed <- renderText({
@trestletech
trestletech / server.R
Last active May 10, 2017 21:24
Shiny example with a custom layout that filters the 'mpg' dataset from the 'ggplot2' library and displays the output in a table.
library(shiny)
# Load the ggplot2 package which provides
# the 'mpg' dataset.
library(ggplot2)
# Define a server for the Shiny app
shinyServer(function(input, output) {
# Filter data based on selections