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
title: monorepo |
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(ahp) | |
library(data.tree) | |
vacation <- Load("vacation.ahp") | |
# look at the structure | |
vacation | |
# look at some preference dfs |
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
Version: 2.0 | |
Alternatives: &alternatives | |
Port 1: | |
shortname: p1 | |
Port 2: | |
shortname: p2 | |
Goal: | |
name: Port Risk | |
description: > | |
Evaluate Port Risk in the perspective of the Belt and Road Initiative. |
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(data.tree) | |
data(acme) | |
acme$Set(len = runif(acme$totalCount)) | |
# see ?as.data.frame.Node for more details | |
ToDataFrameTree(acme, | |
parent = function(node) node$parent$name, | |
child = "name", | |
len.parent = function(node) node$parent$len, | |
len.child = "len", |
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
Version: 2.0 | |
##################################### | |
# Alternatives Section | |
# | |
Alternatives: &alternatives | |
# Here, we list all the alternatives, together with their attributes. | |
# We can use these attributes later in the file when defining | |
# preferenceFunctions. The attributes can be quantitative or |
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
Fun: | |
preferences: | |
Dad: | |
pairwise | |
- [Cargo Capacity, Passenger Capacity, 1/5] | |
Mom: | |
pairwise | |
- [Cargo Capacity, Passenger Capacity, 1/5] | |
Kid: | |
pairwise |
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
graph <- structure(list(graph_info = structure(list(graph_id = "i4wrALpq", | |
graph_name = "graph_i4wrALpq", graph_time = structure(1482058166.83195, class = c("POSIXct", | |
"POSIXt")), graph_tz = NA_character_, write_backups = FALSE), .Names = c("graph_id", | |
"graph_name", "graph_time", "graph_tz", "write_backups"), row.names = c(NA, | |
-1L), class = "data.frame"), nodes_df = structure(list( |
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
nodes <- structure(list(id = 1:11, style = c("", "", "", "", "", "", "", | |
"", "", "", ""), shape = c("", "", "egg", "egg", "", "egg", "egg", | |
"", "egg", "egg", "egg"), fillcolor = c("", "Thistle", "", "", | |
"", "", "", "LightBlue", "LightBlue", "LightBlue", "LightBlue" | |
), fontname = c("", "", "", "", "", "", "", "", "", "", ""), | |
tooltip = c("- name: Acme Inc.", "This is the accounting department", | |
"- cost: 1e+06\n- p: 0.5", "- cost: 5e+05\n- p: 0.75", "- name: Research", | |
"- cost: 2e+06\n- p: 0.25", "- cost: 750000\n- p: 0.9", "- name: IT", | |
"- cost: 4e+05\n- p: 0.2", "- cost: 250000\n- p: 0.05", "- cost: 50000\n- p: 1" | |
), fontcolor = c("", "Firebrick", "", "", "", "", "", "", |
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(data.tree) | |
library(xts) | |
f <- read.csv("https://gist.githubusercontent.com/gluc/3969bcfb2ddce61d8bdec2f52c133674/raw/16b577a6842492153db8e95ede0062a6187e60ab/hts-data.csv", stringsAsFactors = FALSE) | |
# construct tree | |
# ============== | |
# you may chose a different hierarchy order | |
dfs <- data.frame(pathString = paste("rt", df$u_loc, df$u_code, df$c_code, df$citizenship, df$grade, sep = "/"), stringsAsFactors = FALSE) |
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(data.tree) | |
yaml <- " | |
campus: | |
south: | |
label: campussouth | |
north: | |
label: campusnorth | |
" |
NewerOlder