1
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?

Rを学びたい Plot結果を画像表示する Step2

Posted at

はじめに

Rを学びたいStep2です。ベクトルの結果を画像表示できるようにしています。

ソースコード

plot.R
# ベクトルの作成
val <- c(12, 2, 5, 8, 7, 10, 3, 6, 9, 4)

# ベクトルの内容を表示
print("ベクトルの内容:")
print(val)

# プロットの作成
plot(val, type = "o", col = "blue", xlab = "Index", ylab = "Value", main = "ベクトルのプロット")

# 平均値の計算
average_val <- mean(val)
cat("平均値:", average_val, "\n")

# 平均値のラインを追加
abline(h = average_val, col = "red", lty = 2)

image.png

1
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
1
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?