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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "VisualEditor0", | |
"Effect": "Allow", | |
"Action": "s3:ListBucket", | |
"Resource": "arn:aws:s3:::project-evident-cnmi", | |
"Condition": { | |
"StringEquals": { |
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
while(working) { | |
drink(coffee) | |
do(work) | |
if(is_empty(coffee)) { | |
if(is_empty(cofeepot)) { | |
coffeepot <- brew(coffeepot) | |
} | |
coffee <- refill(coffee) | |
} | |
} |
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
get_license_info = function() { | |
lic_info = available.packages(filters = c("CRAN", "duplicates"), | |
fields = "License")[, c("Package", "License")] | |
lic_info = as.data.frame(lic_info, stringsAsFactors = FALSE) | |
# take a stab at identifying GPL 3 packages without other license options | |
lic_info$GPL3 = grepl("GPL.*3", lic_info$License) & !grepl("\\|", lic_info$License) | |
return(lic_info) | |
} |
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
library(lmer) | |
library(lmerTest) | |
# Comparing the `lmer` output on identical data frames, one in a list, one not. | |
# This example uses data built in to the `lme4` package, and the model in the `?lmer` help examples. | |
## split data into two groups by subject | |
subject_sample = sample(unique(sleepstudy$Subject), size = length(unique(sleepstudy$Subject)) / 2) | |
sleep_split = split(sleepstudy, f = sleepstudy$Subject %in% subject_sample) |
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
# p1 (1-10) is attribute - determines d: number of sides of dice | |
# p2 (1-10) is skill - determines k: number of dice to keep | |
# p1 + p2 determines n: the number of dice to roll | |
pp = expand.grid(p1 = 1:10, p2 = 1:10) | |
library(dplyr) | |
library(tidyr) | |
pp = pp %>% mutate( |
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
#' Sample of an object. | |
#' | |
#' Shortcut for checking on data. | |
#' @rdname samp | |
#' @param x data.frame (or matrix) to sample from | |
#' @param n number of rows to sample (default is 10) | |
#' @return n random rows of x | |
#' @export | |
samp <- function(x, n) { | |
UseMethod("samp") |