This file contains hidden or 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(gtools) | |
demo_input <- c("fname midname lname","doe john e") #only 2 'names' in this example list. | |
split_list <- strsplit(demo_input, " |-") | |
make_combinations <- function(x){ | |
# Use permutations from the gtools package | |
name_grid <- permutations(3,3,x) | |
apply(X=name_grid, MARGIN=1, FUN=paste0, collapse=' ') |
This file contains hidden or 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
# DrawShape | |
#' @title Draw Shape | |
#' @param n height of shape in number of rows | |
#' @description If n is odd, draw a diamond pattern. | |
#' If n is even, draw an hourglass pattern. | |
#' @note e.g. n = 6 | |
#' ##### | |
#' ### | |
#' # |
This file contains hidden or 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(readr) | |
library(dplyr) | |
library(tibble) | |
# Input CSV | |
input_path <- '/tmp/dahee_coding.csv' | |
input_df <- read_csv(input_path) | |
# Veena's observations are row 1 |
This file contains hidden or 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(tibble) | |
library(dplyr) | |
count_data <- tibble::tribble( | |
~id, ~numerator, ~denominator, | |
"Aly", 14, 20, | |
"Aly", 13, 20, | |
"Aly", 12, 20, | |
"Bob", 11, 20, | |
"Bob", 12, 20, |
This file contains hidden or 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(tidyverse) | |
library(broom) | |
library(doParallel) | |
# set variables to define data | |
n_samples <- 1000000 | |
n_vars <- 10 | |
n_group1 <- 500 | |
n_group2 <- 2 |
This file contains hidden or 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
filters_df <- data.frame(lower = c(0, 10, 20), | |
upper = c(2, 12, 22), | |
filter_name = paste('filter',c('A','B','C'), sep='_')) | |
df <- data.frame(x = 1:30) | |
named_range <- function( lower, upper, name, data) { | |
data > lower & data < upper | |
} |
This file contains hidden or 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(dplyr) | |
df <- structure( | |
list( | |
ID = structure( | |
c( | |
1L, | |
1L, | |
1L, | |
1L, | |
1L, |
This file contains hidden or 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
1500055623049 | 59 | PUT Perf Container | 201 | Created | Fedora4 Create New Containers 1-1 | text | true | 397 | 1 | 1 | 59 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
1500055623144 | 5 | OPTIONS Perf Container | 200 | OK | Fedora4 Create New Containers 1-1 | true | 373 | 1 | 1 | 5 | ||
1500055623186 | 16 | GET Perf Container | 200 | OK | Fedora4 Create New Containers 1-1 | text | true | 2396 | 1 | 1 | 15 | |
1500055623221 | 33 | PATCH Perf Container | 204 | No Content | Fedora4 Create New Containers 1-1 | true | 208 | 1 | 1 | 0 | ||
1500055623268 | 11 | DELETE Perf Container | 204 | No Content | Fedora4 Create New Containers 1-1 | true | 110 | 1 | 1 | 0 | ||
1500055640870 | 18 | PUT Perf Container | 201 | Created | Fedora4 Create New Containers 1-1 | text | true | 397 | 1 | 1 | 18 | |
1500055640901 | 4 | OPTIONS Perf Container | 200 | OK | Fedora4 Create New Containers 1-1 | true | 373 | 1 | 1 | 4 | ||
1500055640920 | 19 | GET Perf Container | 200 | OK | Fedora4 Create New Containers 1-1 | text | true | 2396 | 1 | 1 | 19 | |
1500055640951 | 23 | PATCH Perf Container | 204 | No Content | Fedora4 Create New Containers 1-1 | true | 208 | 1 | 1 | 0 | ||
1500055641005 | 17 | DELETE Perf Container | 204 | No Content | Fedora4 Create New Containers 1-1 | true | 110 | 1 | 1 | 0 |
This file contains hidden or 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
# If logging into mimosa | |
# start ssh-agent and add key(s) | |
BASTION_HOST='bastion.example.com' | |
if [[ ${HOSTNAME} = ${BASTION_HOST} ]]; then | |
# start ssh-agent if not running | |
if [ -z "$SSH_AUTH_SOCK" ]; then | |
eval `/usr/bin/ssh-agent -s` | |
fi |
This file contains hidden or 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
require 'watir' | |
require 'fileutils' | |
require 'pry' | |
# Given url and destination directory | |
def scrape_tables(browser, url, dest_dir) | |
# create subdirectory | |
FileUtils.mkdir_p dest_dir | |
browser.goto url |