0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

R > データセットを減らす > newx<-x[1:5]

Last updated at Posted at 2016-09-11
動作環境
RStudio @ rollapp
R version 3.3.0

Excelのデータと自分が計算で求めた結果を比較したい。
Rではデータセット数が異なるものでplot(x,y)するとエラーになる。
データ数が同じになるようにサブセットを作る必要がある。

データセットからサブデータセットを得る方法は以下に見つけた。
http://www.statmethods.net/management/subset.html

> x<-1:10
> newx<-x[1:5]
> newx
[1] 1 2 3 4 5

「1から10の値」から「1から5のサブセット」を取得できた。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?