This file contains 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('tidyverse') | |
locale( | |
date_names = "en", | |
date_format = "%AD", | |
time_format = "%AT", | |
decimal_mark = ".", | |
grouping_mark = ",", | |
tz = "Asia/Tokyo", | |
encoding = "CP932", |
This file contains 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(tidyverse) | |
tidyToChisq <- function(data, col, row) { | |
return( | |
data %>% group_by_(col, row) %>% | |
summarise(count = n()) %>% spread(row, count, fill = 0) %>% | |
ungroup() %>% select(-starts_with(col)) %>% as.matrix() %>% chisq.test()) | |
} |
This file contains 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("tidyverse") | |
library("dummies") | |
iris %>% select(Species) %>% dummy.data.frame(., c("Species"), sep="_") |
This file contains 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
install.packages("xlsx") | |
library("xlsx") | |
n <- 10 | |
a <- list() | |
for(i in 1:n) { | |
a[[i]] <- read.xlsx("data.xlsx", sheetIndex=i, encoding="UTF-8", header = FALSE) | |
} | |
data <- do.call(rbind, a) |
This file contains 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
sum_runif <- function(x) { | |
a <- runif(n = 1000) | |
if (x <= 1) return(a) | |
else return(a + Recall(x-1)) | |
} | |
hist(sum_runif(5)) | |
hist(sum_runif(1)) | |
hist(sum_runif(10)) |
We can't make this file beautiful and searchable because it's too large.
This file contains 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
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 尿路性器系の疾患 |
This file contains 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
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 | 感染症および寄生虫症 |
This file contains 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
# ggplot2 をベースにしたペアプロットのサンプル | |
install.packages("GGally") | |
library(GGally) | |
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)) |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
$ sudo apt-get install build-essential libncurses5-dev openssl libssl-dev | |
$ wget http://erlang.org/download/otp_src_R15B01.tar.gz | |
$ tar zxvf otp_src_R15B01.tar.gz | |
$ cd otp_src_R15B01 | |
$ ./configure && make && sudo make install |
NewerOlder