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
$ LANG=C xdg-user-dirs-gtk-update | |
$ sudo apt-get update | |
$ sudo apt-get upgrade | |
$ dconf reset /org/gnome/settings-daemon/plugins/keyboard/active | |
$ dconf write /org/gnome/desktop/input-sources/xkb-options "['ctrl:swapcaps']" | |
add repos: | |
$ sudo vim /etc/apt/sources.list |
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
# lapplyでgeom_segment()を繰り返し記述 | |
p <- ggplot(iris, aes(y=Sepal.Width, x=Species)) + | |
stat_summary(fun.y=mean, geom = "bar") + | |
ylim(0,6) + | |
lapply(1:3, function(i) geom_segment(x=i-0.4, y=7-i, xend=i+0.4, yend=7-i)) | |
p | |
# あと教えてもらったmapply使ったサンプルコードメモ | |
q = ggplot(data.frame(x = c(-10, 10)), aes(x)) + | |
mapply(function(m, s, co) stat_function(fun = dnorm, args = list(mean = m, sd = s), colour = co), |
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("dplyr") | |
library("rvest") | |
library("stringr") | |
library("leaflet") | |
trg <- html("http://www.jma.go.jp/jp/typh/") %>% html_table | |
tbl1 <- trg[[4]] # テーブルは4番目以降が台風に関するもので今回は台風15号と16号があるので4を指定 | |
res <- data.frame( | |
timing = tbl1$X1 %>% str_subset("[0-9][0-9]日[0-9][0-9]時"), |
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(dygraphs) | |
library(xts) | |
daylab <- seq(as.Date("2010-07-29"), as.Date("2010-8-10"), by="days") | |
val1 <- runif(length(daylab)) | |
val2 <- runif(length(daylab)) | |
vals <- data.frame(value1 = val1, value2 =val2) | |
rownames(vals) <- daylab | |
series <- xts(vals, order.by = daylab, tx="GMT") | |
dygraph(series) |
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
--- | |
title: "revealjsのテスト" | |
author: "kazutan" | |
date: "2015年9月18日" | |
output: | |
revealjs::revealjs_presentation: | |
theme: sky | |
center: true | |
css: "test.css" | |
--- |
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
/* for {revealjs} */ | |
.reveal section.slide>h1 { | |
color: blue; | |
} | |
.reveal .progress { | |
height: 15px; |
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
> sessionInfo() | |
R version 3.2.2 (2015-08-14) | |
Platform: x86_64-pc-linux-gnu (64-bit) | |
Running under: Ubuntu 14.04.3 LTS | |
locale: | |
[1] LC_CTYPE=ja_JP.UTF-8 LC_NUMERIC=C LC_TIME=ja_JP.UTF-8 | |
[4] LC_COLLATE=ja_JP.UTF-8 LC_MONETARY=ja_JP.UTF-8 LC_MESSAGES=ja_JP.UTF-8 | |
[7] LC_PAPER=ja_JP.UTF-8 LC_NAME=C LC_ADDRESS=C | |
[10] LC_TELEPHONE=C LC_MEASUREMENT=ja_JP.UTF-8 LC_IDENTIFICATION=C |
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
# 以下のリンクを参考にすること | |
# http://gihyo.jp/admin/serial/01/ubuntu-recipe/0344 | |
# 事前にRSA鍵を作っとく | |
# uvtoolsのインストール | |
$ sudo apt install uvtool | |
# 14.04のイメージダウンロード | |
# 結構時間かかる |
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(dplyr) | |
library(ggplot2) | |
# 水準ごとの平均値を算出 | |
xx <- iris %>% | |
group_by(Species) %>% | |
summarise(a=mean(Sepal.Width)) | |
# ボックスプロット(ベース)作成 |
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
path <- getwd() | |
write.csv(iris, "iris-tan.csv") | |
write.csv(iris, "iris-tan2.csv") | |
write.csv(iris, "iris-tan3.csv") | |
ss <- list.files(path,pattern = "iris-") | |
iristan <- data.frame() | |
for (i in 1:length(ss)) { | |
d <- read.csv(ss[i]) |
OlderNewer