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
Pathways-attributes matrix | |
A B C | |
p0 0 0 0 | |
p1 0 0 1 | |
p2 0 1 0 | |
p3 1 0 0 | |
p4 0 1 1 | |
p5 1 0 1 | |
p6 1 1 0 | |
p7 1 1 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
# Generate single round of meetings. | |
# from a data frame with `agentNo` and `state` cols. | |
generate_meetings <- function(agent_df){ | |
# 1 Make a list of Buyer agents | |
is_a_buyer <- agent_df$state == "Buyer" | |
buyers_ids <- agent_df[is_a_buyer, c('agentNo')] | |
# 2 Make list of Seller agents | |
is_a_seller <- agent_df$state == "Seller" | |
sellers_ids <- agent_df[is_a_seller, c('agentNo')] |
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
# Author: Colin Gross | |
# Date: 2022-02-22 | |
#' Simple group assignments. | |
#' Randomly order equally distributed group ids | |
#' @param num_groups Number of study groups | |
#' @param num_per_group Number of individuals per group. | |
#' @return named vector of randomly selected group assignments. | |
simple_grp_assignments <- function(num_groups, num_per_group){ | |
num_indv <- num_groups * num_per_group |
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
structure(list(StandID = c("BEF 15", "NUL 10", "BEF 16", "NUL 2", | |
"BEF 17", "NUL 8", "BEF 17", "BEF 17", "BEF 14", "NUL 14", "NUL 1", | |
"NUL 13", "NUL 15", "NUL 6", "NUL 13", "BEF 11", "BEF 14", "NUL 15", | |
"BEF 16", "BEF 3", "NUL 14", "BEF 3", "BEF 14", "NUL 3", "BEF 11", | |
"BEF 2", "NUL 2", "BEF 16", "BEF 8", "BEF 3", "BEF 8", "NUL 4", | |
"BEF 9", "BEF 17", "BEF 7", "NUL 14", "BEF 17", "NUL 10", "NUL 4", | |
"NUL 13", "NUL 9", "NUL 10", "BEF 3", "BEF 2", "BEF 3", "NUL 13", | |
"NUL 15", "NUL 6", "NUL 4", "NUL 7", "BEF 11", "NUL 10", "NUL 5", | |
"NUL 9", "BEF 1", "NUL 12", "NUL 5", "BEF 8", "NUL 7", "NUL 8", | |
"BEF 9", "BEF 1", "NUL 2", "NUL 8", "BEF 7", "BEF 8", "BEF 9", |
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
rosen_height <- function(x,y) { | |
100 * (y-x^2)^2 + (1-x)^2 | |
} | |
gradient <- function(x,y) { | |
val_x <- -400*x*(y-x^2)-2*(1-x) | |
val_y <- 200*(y-x^2) | |
return( c(val_x, val_y) ) | |
} |
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
--- | |
# | |
# This template example assumes a UserPool and UserPoolDomain exist. | |
# The function of this is to produce a custom resource with an attribute | |
# that can be referenced for DNSName of an Route53::RecordSet AliasTarget. | |
# | |
# AliasTarget: | |
# HostedZone: Z2FDTNDATAQYW2 | |
# DNSNAME: !GetAtt UPDomain.CloudFrontDistribution |
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
options( | |
repos = c(CRAN = "https://cran.rstudio.com/"), | |
browserNLdisabled = TRUE, | |
deparse.max.lines = 2) | |
# Set lib path | |
.libPaths( "~/R/x86_64-pc-linux-gnu-library/dev/" ) | |
if (interactive()) { | |
suppressMessages(require(devtools)) |
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
# regarding: https://www.reddit.com/r/Rlanguage/comments/d0ytw7/issues_of_bias_with_rnorm/ | |
# set the RNG seed so the results are reporducible | |
set.seed(12345) | |
# Generate 100 target means beteen 0 and 100 from the uniform distribution | |
generated_means <- runif(100, 0, 100) | |
# Generate 100 standard deviation values also from uniform distribution | |
generated_sdev <- runif(100, 1, 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
#!/bin/bash | |
# Consider the following structure where this script is target.sh | |
# /tmp/ | |
# ├── target.sh | |
# └── l1 | |
# ├── one.sh -> ../target.sh | |
# └── l2 | |
# └── two.sh -> ../one.sh | |
# From your home directory run: |
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
{ | |
"MAPT_data_points":[ | |
{ "performer": "Alice", | |
"time": "2019-01-01", | |
"measure": "Documentation Rate", | |
"performance": "0.90" | |
}, | |
{ "performer": "Alice", | |
"time": "2019-02-01", | |
"measure": "Documentation Rate", |
NewerOlder