This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install.packages('nycflights13') | |
library(nycflights13) | |
library(dplyr) | |
dim(flights) | |
flights | |
df = flights | |
# Curtis Kephart | |
# [email protected] | |
# Questions and solution for Prof Morton's Experimental PoliSci R assignment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' 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. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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"), |