Moved to a repo at https://github.com/Geczy/coolify-migration
| library(dplyr) | |
| library(arrow) | |
| library(duckdb) | |
| # install.packages(c("dplyr", "arrpw", "duckdb", "nycflights13")) | |
| ## Export the nycflights13 dataset to arrow format ---- | |
| nycflights13::flights |> |
| /* | |
| * Async.gs | |
| * | |
| * Manages asyncronous execution via time-based triggers. | |
| * | |
| * Note that execution normally takes 30-60s due to scheduling of the trigger. | |
| * | |
| * @see https://developers.google.com/apps-script/reference/script/clock-trigger-builder.html | |
| */ |
| # gridSVG::grid.garnish can be used to add SVG attributes to elements of a plot! | |
| # we don't even need to do it one at a time: with the option `group = FALSE`, we | |
| # can give it a vector of values for an attribute and garnish an entire geom at | |
| # once. the only rub is that sometimes ggplot2 shuffles your data around when | |
| # plotting it. we need to check how the data was reordered, and arrange our | |
| # original data to match, before we send it to grid.garnish. | |
| library(tidyverse) | |
| library(magrittr) | |
| library(grid) |
| def measure_semantic_shift_by_neighborhood(model1,model2,word,k=25,verbose=False): | |
| """ | |
| Basic implementation of William Hamilton (@williamleif) et al's measure of semantic change | |
| proposed in their paper "Cultural Shift or Linguistic Drift?" (https://arxiv.org/abs/1606.02821), | |
| which they call the "local neighborhood measure." They find this measure better suited to understand | |
| the semantic change of nouns owing to "cultural shift," or changes in meaning "local" to that word, | |
| rather than global changes in language ("linguistic drift") use that are better suited to a | |
| Procrustes-alignment method (also described in the same paper.) | |
| Arguments are: |
| sudo apt-get remove \ | |
| aisleriot \ | |
| brltty \ | |
| duplicity \ | |
| empathy \ | |
| empathy-common \ | |
| example-content \ | |
| gnome-accessibility-themes \ | |
| gnome-contacts \ | |
| gnome-mahjongg \ |
The range sliders at the top change the values for the force-directed algorithm and the buttons load new graphs and apply various techniques. This will hopefully serve as a tool for teaching network analysis and visualization principles during my Gephi courses and general Networks in the Humanities presentations.
Notice this includes a pretty straightforward way to load CSV node and edge lists as exported from Gephi.
It also includes a pathfinding algorithm built for the standard data structure of force-directed networks in D3. This requires the addition of .id attributes for the nodes, however.
Now with Clustering Coefficients!
Also, it loads images for nodes but the images are not in the gist. The code also refers to different network types but the data files on Gist only refer to the transportation network.