2020-03-01から1ヶ月間の記事一覧

Rで複数の系列を異なるタイプでプロットする方法

How to plot multiple series with different types R言語でヒストグラムとラインプロットを組み合わせる x <- seq(-2, 2, 0.01) y1 <- pnorm(x) y2 <- pnorm(x, 1, 1) plot(x,y1,type="l",col="red") lines(x,y2,col="green",type="h") Results ヒストグラ…

Rでデータの丸点つきのラインをプロットする方法

Example type = "o" を指定する ここでx: timeSeries型。 set.seed(1) x = ts(rnorm(20), frequency = 12, start = c(2002, 2)) ts.plot(x, gpars=list(xlab="year", ylab="random value", lwd=c(1:4), col=c("red"),type="o")) Reuslts pointLine

RでtimeSeries型をhistogramでplotする方法

How to plot histgram(bar) graph with timeSeries Type data. R言語でtimeSeries型をヒストグラムでプロットする方法 set.seed(1) x = ts(rnorm(20), frequency = 12, start = c(2002, 2)) ts.plot(x, gpars=list(xlab="year", ylab="random value", lwd=c(…

timeSeries型で二つの系列をプロットする方法

How to plot two series with timeSeries type in R programing. ts.plot の引数に複数のtimeseriesを渡す Reuslts ラベルをつけたい場合 Results 線を太くしたい場合:lwd (line width) Reuslts cbindを使って結合する方法 2系列を2段に分けるcbind + mult…

Rで行数が同じ2つのデータを結合する方法

R言語で行数が同じ2つのデータを結合する方法 cbindを使う cbind(x, y) x,y ...が同じ行数である場合、結合できる。

Rで型を見る方法

R言語で型を見る方法 > str(data) > class(data)

Rでdataframeの型を見る方法

R言語でdataframeの型を見る方法 data<- read.csv(file = "test.csv", header=TRUE) sapply(data, class)