Skip to content

Instantly share code, notes, and snippets.

kohske takahashi kohske

Block or report user

Report or block kohske

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
View 平均への回帰.Rmd
---
title: "heikinn-eno-kaiki"
author: "kohske"
output: html_document
editor_options:
chunk_output_type: console
---
```{r}
library(plyr)
View iris.tsv
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1 5.1 3.5 1.4 0.2 setosa
2 4.9 3 1.4 0.2 setosa
3 4.7 3.2 1.3 0.2 setosa
4 4.6 3.1 1.5 0.2 setosa
5 5 3.6 1.4 0.2 setosa
6 5.4 3.9 1.7 0.4 setosa
7 4.6 3.4 1.4 0.3 setosa
8 5 3.4 1.5 0.2 setosa
9 4.4 2.9 1.4 0.2 setosa
@kohske
kohske / ch01.Rmd
Created May 16, 2018
rmarkdown child
View ch01.Rmd
---
title: "ch01"
output: html_document
---
```{r}
library(ggplot2)
a = 1
b = 2
a
@kohske
kohske / susume.txt
Created May 9, 2018
「再現可能性のすゝめ」という本を書きました
View susume.txt
教室出版さんのWonderful Rのシリーズで「再現可能性のすゝめ―RStudioによるデータ解析とレポート作成―」という本を書きました。
公式サイト: http://www.kyoritsu-pub.co.jp/bookdetail/9784320112438
Amazon: https://www.amazon.co.jp/gp/product/4320112431
書籍紹介より
> データ解析とレポート作成の再現性を高めよう。その先には、ボスの笑顔が待っている。
> RStudioを使いこなそう。その先には、旨いお鮨が待っている。
> Rマークダウンをマスターしよう。その先には、明るい未来が待っている。
@kohske
kohske / promax2.r
Created May 9, 2018
score付きpromax2
View promax2.r
# zmatにはfactanalに渡したデータをもう一度渡す(因子得点計算用)
promax2 <- function (x, power = 4, kaiser = TRUE, zmat = NULL)
{
if (!is.matrix(x) & !is.data.frame(x)) {
if (!is.null(x$loadings))
x <- as.matrix(x$loadings)
}
else {
x <- x
}
@kohske
kohske / ckt.r
Created Apr 23, 2018
dist of mean of dist
View ckt.r
R=10000; N=1000
xm = numeric(R)
for (i in 1:R) {
#好きなように
xm[i] = mean(rlnorm(N))
# xm[i] = mean(rexp(N))
# xm[i] = mean(runif(N))
}
hist(xm, breaks = 100, probability = TRUE)
@kohske
kohske / mlwave.r
Created Mar 13, 2018
Müller-Lyer Wave
View mlwave.r
library(grid)
o = function(th) {
yd = -0.5
grid.circle(0, 1, 0.25)
grid.lines(c(0, 0), c(yd, 1-0.25))
grid.lines(c(0, 0), c(yd, 0.5), gp = gpar(col="blue", lwd = 3))
f = 0.25
grid.lines(c(0, -cos(th)*f), c(0.5, 0.5+sin(th)*f), gp = gpar(lwd=3))
grid.lines(c(0, +cos(th)*f), c(0.5, 0.5+sin(th)*f), gp = gpar(lwd=3))
View gg.R
library(ggplot2)
library(gtable)
a = ggplot(data=diamonds, aes(x=price)) + geom_histogram()
b = ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width)) + geom_point()
agg = ggplot_gtable(ggplot_build(a))
bgg = ggplot_gtable(ggplot_build(b))
g = gtable(width=unit(c(0.3, 0.5), "null"), height = unit(1, "null"))
g = gtable_add_grob(g, agg, 1,1)
g = gtable_add_grob(g, agg, 1,2)
@kohske
kohske / BCI.R
Created Dec 8, 2017
Reproducible Example of Curvature Blindness Illusion
View BCI.R
# Reproducible Example of
# Curvature Blindness Illusion
# Kohske Takahashi, Chukyo University, Japan
# ref: http://journals.sagepub.com/doi/abs/10.1177/2041669517742178
library(grid)
grid.newpage()
# some params
NY = 48
@kohske
kohske / hoge.Rmd
Created Oct 11, 2017
knitr include graphics
View hoge.Rmd
---
title: "Untitled"
author: '@kohske'
date: "2017/10/11"
output: beamer_presentation
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
You can’t perform that action at this time.