LoginSignup
1
2

More than 5 years have passed since last update.

Rの基本[メモ]

Posted at

データ入力

c()を使う

variable <- c(data1,data2,...)

csvファイルなどを読み込む場合は

x<-read.csv(“name.csv”,header=T, row.name=1)

functions

mean(x)
var(x)
var(x,y)
cor(x,y)
sd(x): 標本標準偏差
median(x)

probability

n=N,p=Pの2港分布に従う確率変数がXになる確率
dbinom(X,N,p=P)
などなど

Random values

data <-rnorm(n,mean,sd)

visual aids

hist():ヒストグラム

|arguments|explanation|
|:--------------:|:------------------:|
| breaks|階級幅|
|col | color|

plot(x,y):散布図

curve(dnorm(x),from,to(,add=T)):正規分布

どこに書くか

スクリプト
「ファイル」→「新規文書」

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2