Skip to content

Instantly share code, notes, and snippets.

View EconomiCurtis's full-sized avatar

Curtis Kephart EconomiCurtis

  • Posit / RStudio. Formerly of New York University Abu Dhabi and @SSEL-NYU, and UC Santa Cruz and LEEPS Lab
  • USA
View GitHub Profile
@EconomiCurtis
EconomiCurtis / Parts-of-a-gt-Table.Rmd
Created April 8, 2020 19:05
"Parts of a gt Table" made with gt
# fun with the gt package.
# replicating the "Parts of a gt Table" at
# https://blog.rstudio.com/2020/04/08/great-looking-tables-gt-0-2/
library(dplyr)
library(gt)
data.frame(
row_label = c("ROW LABEL 1", "ROW LABEL 2"),
#' I had a quick chat with Nikos earlier today,
#' and I need to generate the same analysis Nikos described for three separate data sets
#' (they're all attached and include variables labelled task2score and task3score respectively).
#' In the end what I'm trying to calculate is the probability a subject's task 3 score is
#' strictly lower than a randomly selected task 2 score from the same experiment.
#' Each file contains only the observations I need to include in the analysis.
@EconomiCurtis
EconomiCurtis / heatmap_r
Last active August 29, 2017 21:17
R Heatmap Notes
# Instructions
# `d` is the example datastructure
# `n` in kde2d is the granularity of the heatmap. It's how many pixels appears on the vertical and horizontal axes (total pixels is n^2)
# `n` in colours / rainbow controls the colors of the heatmap rainbow.
# `cuts` in levelplot also controls the smoothness of the color bleeding between pixels.
# - I don't think `cuts` can be set to more than the integer in `col.regions=rgb.palette(150)`.
# package
require(lattice)
require(MASS)
@EconomiCurtis
EconomiCurtis / Start.js
Created April 18, 2017 04:00
Start.js for bubbles vcm
Redwood.controller("SubjectCtrl", ["$rootScope", "$scope", "RedwoodSubject", 'SynchronizedStopWatch', function($rootScope, $scope, rs, SynchronizedStopWatch) {
//Controls tick frequency for refreshing of flow chart
var CLOCK_FREQUENCY = 7;
var LOG_FREQUENCY = 7;
//Controls how often the slider is allowed
// to update the user's value. In ms.
var SLIDER_REFRESH_TIME = 60;
@EconomiCurtis
EconomiCurtis / r_assignment_solutions.r
Created April 12, 2017 05:57
Morton Experimental PoliSci R Assignment Solution
install.packages('nycflights13')
library(nycflights13)
library(dplyr)
dim(flights)
flights
df = flights
# Curtis Kephart
# curtis.kephart@nyu.edu
# Questions and solution for Prof Morton's Experimental PoliSci R assignment.