Skip to content

Instantly share code, notes, and snippets.

@beemyfriend
beemyfriend / Mayor's Order 2020-054 Stay at Home.txt
Created March 31, 2020 00:56
DC Mayor's Order: Obtain Text
GOVERNMENT OF THE DISTRICT OF COLUMBIA
ADMINISTRATIVE ISSUANCE SYSTEM
Mayor’s Order 2020-054
March 30, 2020
SUBJECT: Stay at Home Order
ORIGINATING AGENCY: Office of the Mayor
By virtue of the authority vested in me as Mayor of the District of Columbia pursuant to section
@beemyfriend
beemyfriend / index.html
Last active August 11, 2019 08:24
Let's try to explore the different layers of a multigraph
<head>
<script src="https://d3js.org/d3.v5.min.js"></script>
</head>
<body>
<svg></svg>
<button>Toggle Pane Position</button>
</body>
<script>
//Data represents different layers of a multigraph
//a seperate layer for each node type
@beemyfriend
beemyfriend / social_judgment_theory.r
Created May 1, 2019 05:55
social_judgment_theory
library(tidyverse)
library(igraph)
library(animation)
#individual check
#attribute: position (-5 to 5)
#attribute: lattitude of acceptance (range of +-1 )
#attribute: lattitude of noncommitment (range of +- 2)
#Specifically, it predicts that the more discrepant a message is from a listener’s own attitude (the greater the difference between the audience attitude and the position adopted in the message), as long as the message doesn’t fall into the latitude of rejection, the more persuasive that message will be.
@beemyfriend
beemyfriend / drug_attitude
Created February 7, 2019 18:52
rehab cycle model factoring in relationships
library(igraph)
library(animation)
node_clr <- scales::brewer_pal()(6)
###===============================###
### initiate full graph influence ###
###===============================###
addSimAtt <- function(g){
@beemyfriend
beemyfriend / index.html
Last active January 10, 2019 05:33
A toy agent based model that simulates the cycle of going in and out of rehab
<head>
<meta charset="utf-8" />
</head>
<body>
<svg></svg>
</body>
<script src="d3.v5.min.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script> -->
<script src="d3-jetpack.js"></script>
<script>
#Urban Complexity
library(tidyverse)
library(tmap)
library(tmaptools)
library(osmdata)
library(sf)
library(stplanr)
library(igraph)
@beemyfriend
beemyfriend / speaker_ascii.gif
Created November 14, 2018 08:42
ascii art animation
```{r, message=F}
library(tidyverse)
library(imager)
library(cowplot)
library(animation)
library(tweenr)
```
@beemyfriend
beemyfriend / ccs_2018_graph.R
Last active September 28, 2018 06:52
Mining CCS 2018 Presentation Data and Creating. a Graph
library(tidyverse)
library(rvest)
library(igraph)
##########
## Pull Data from website
##########
html <- read_html("http://ccs2018.web.auth.gr/schedule")
@beemyfriend
beemyfriend / traversingtrees.r
Last active September 27, 2018 05:40
Moving around a tree
library(tidyverse)
library(igraph)
###Fake Taxonomy
g <- make_tree(20, 2) %>%
set_edge_attr('arrow.size', value = .5) %>%
set_vertex_attr('name', value = 1:vcount(.)) %>%
set_vertex_attr('label.cex', value = .7) %>%
set_graph_attr('layout', layout_as_tree(.))
@beemyfriend
beemyfriend / circlecolorgame.R
Created September 25, 2018 21:51
Playing around with the color game
library(tidyverse)
library(igraph)
library(animation)
library(grid)
library(gridGraphics)
############
## Only working with 3 possible colora
############