Skip to content

Instantly share code, notes, and snippets.

require(R6)
dog <- list(name = 'hundno', say = 'whhooo!')
class(dog) <- "animal"
cat <- list(name = 'kitty', say = 'meow!')
class(cat) <- "animal"
ipad <- list(name = "iPad mini")
class(ipad) <- "computer"
@chainsawriot
chainsawriot / popol.R
Created September 16, 2019 11:42
bimodal
require(tidyverse)
require(tidyr)
require(moments)
nrespondants <- c(223, 41, 63, 86, 64, 251, 82, 73, 74, 17, 64, 168, 43, 47, 64, 35, 135, 28, 15, 43, 10, 43, 366, 45, 73, 50, 26, 121, 25, 38, 44, 5, 46, 260, 36, 54, 49, 31, 63, 26, 30, 29, 3, 44)
score <- rep(0:10, 4)
wave <- sort(rep(1:4, 11))
@chainsawriot
chainsawriot / rang.R
Last active February 16, 2023 16:27
require(rang)
require(purrr)
require(igraph)
convert_edgelist <- function(x) {
output <- data.frame(x = x$pkg, y = rang:::.extract_queryable_dependencies(x$original, x$no_enhances, x$no_suggests))
for (dep in x$deps) {
if (!rang:::.is_terminal_node(dep, x$no_enhances)) {
el <- data.frame(x = unique(dep$x_pkgref), y = rang:::.extract_queryable_dependencies(dep, x$no_enhances, x$no_suggests))
output <- rbind(output, el)
use_eupl <- function() {
EUPL_BZIP2 <- as.raw(c(0x42, 0x5a, 0x68, 0x39, 0x31, 0x41, 0x59, 0x26, 0x53,
0x59, 0xfb, 0x2b, 0x04, 0x38, 0x00, 0x04, 0xb0, 0x5f, 0xf5, 0x00,
0x10, 0x48, 0xff, 0xff, 0xf9, 0x3f, 0xf7, 0xfe, 0xa0, 0x3f, 0xff,
0xff, 0xf0, 0x40, 0x00, 0x04, 0x60, 0x00, 0x20, 0x18, 0x00, 0x10,
0x00, 0x60, 0x16, 0xfd, 0x35, 0xaf, 0xb7, 0x68, 0x28, 0x03, 0xd0,
0x00, 0x1e, 0x95, 0x7b, 0xeb, 0x2f, 0xbe, 0xe3, 0x59, 0x73, 0xaa,
0xa4, 0xfa, 0x5e, 0x87, 0xb4, 0x29, 0x5e, 0xde, 0x62, 0xed, 0xb1,
0xec, 0x68, 0x96, 0xdb, 0xde, 0xd5, 0xd9, 0xb5, 0xb6, 0xd6, 0x16,
0x3a, 0xee, 0xef, 0x4f, 0x5a, 0xeb, 0xdd, 0xb9, 0xe9, 0x4f, 0x0c,