Skip to content

Instantly share code, notes, and snippets.

sato hiroyuki hrstt

Block or report user

Report or block hrstt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
hrstt /
Last active Nov 29, 2019
for chisq.test, convert count data to matrix with tidyverse
tidyToChisq <- function(data, col, row) {
data %>% group_by_(col, row) %>%
summarise(count = n()) %>% spread(row, count, fill = 0) %>%
ungroup() %>% select(-starts_with(col)) %>% as.matrix() %>% chisq.test())
View create_dummy_column.R
iris %>% select(Species) %>%, c("Species"), sep="_")
hrstt / merge_each_excel_sheets.r
Created Nov 11, 2016
View merge_each_excel_sheets.r
n <- 10
a <- list()
for(i in 1:n) {
a[[i]] <- read.xlsx("data.xlsx", sheetIndex=i, encoding="UTF-8", header = FALSE)
data <-, a)
hrstt / summing_runif_is_instead_of_rnorm.R
Created Nov 11, 2016
View summing_runif_is_instead_of_rnorm.R
sum_runif <- function(x) {
a <- runif(n = 1000)
if (x <= 1) return(a)
else return(a + Recall(x-1))
hrstt / icd10list_NtoZ.tsv
Created Oct 18, 2016
ICD10 国際疾病分類第10版(2003年改訂) # ref:
View icd10list_NtoZ.tsv
We can't make this file beautiful and searchable because it's too large.
ICD10(except dot) ICD10 name order topcategory
N00 N00 急性腎炎症候群 14 尿路性器系の疾患
N000 N00.0 急性腎炎症候群,軽微糸球体変化 14 尿路性器系の疾患
N001 N00.1 急性腎炎症候群,巣状及び分節状糸球体変化 14 尿路性器系の疾患
N002 N00.2 急性腎炎症候群,びまん性膜性糸球体腎炎 14 尿路性器系の疾患
N003 N00.3 急性腎炎症候群,びまん性メザンギウム増殖性糸球体腎炎 14 尿路性器系の疾患
N004 N00.4 急性腎炎症候群,びまん性管内増殖性糸球体腎炎 14 尿路性器系の疾患
N005 N00.5 急性腎炎症候群,びまん性メザンギウム毛細管性糸球体腎炎 14 尿路性器系の疾患
N006 N00.6 急性腎炎症候群,デンスデポジット病 14 尿路性器系の疾患
N007 N00.7 急性腎炎症候群,びまん性半月体形成性糸球体腎炎 14 尿路性器系の疾患
hrstt / icd10list_AtoM.tsv
Last active Oct 18, 2016
ICD10 国際疾病分類第10版(2003年改訂) ref:
View icd10list_AtoM.tsv
ICD10(except dot) ICD10 name order topcategory
A00 A00 コレラ 1 感染症および寄生虫症
A000 A00.0 コレラ菌によるコレラ 1 感染症および寄生虫症
A001 A00.1 エルトールコレラ菌によるコレラ 1 感染症および寄生虫症
A009 A00.9 コレラ,詳細不明 1 感染症および寄生虫症
A01 A01 腸チフス及びパラチフス 1 感染症および寄生虫症
A010 A01.0 腸チフス 1 感染症および寄生虫症
A011 A01.1 パラチフスA 1 感染症および寄生虫症
A012 A01.2 パラチフスB 1 感染症および寄生虫症
A013 A01.3 パラチフスC 1 感染症および寄生虫症
View pair_plot.R
# ggplot2 をベースにしたペアプロットのサンプル
airquality$Month <- as.factor(airquality$Month)
airquality <- airquality[, colnames(airquality) != "Day"]
ggpairs(na.omit(airquality), lower=list(continuous="smooth"), colour="Month", params=list(corSize=6,labelSize=10))
hrstt / 0_reuse_code.js
Created Dec 19, 2013
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
hrstt / file0.txt
Created Mar 26, 2013
Ubuntu 12.10 にRiak 1.3.0 を用意する ref:
View file0.txt
$ sudo apt-get install build-essential libncurses5-dev openssl libssl-dev
$ wget
$ tar zxvf otp_src_R15B01.tar.gz
$ cd otp_src_R15B01
$ ./configure && make && sudo make install
hrstt / add_event.sql
Created Mar 26, 2013
7つのデータベース 7つの世界 2章 PostgreSQL 2日目 ref:
View add_event.sql
CREATE OR REPLACE FUNCTION add_event(title text, starts timestamp, ends timestamp, venue text, postal varchar(9), country char(2) )
RETURNS boolean AS $$
did_insert boolean := false;
found_cont integer;
the_venue_id integer;
SELECT venue_id INTO the_venue_id
FROM venues v
You can’t perform that action at this time.