1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

RAdvent Calendar 2024

Day 6

Rを学びたい Step5(ヒストグラム)

Posted at

はじめに

Rを学びたいStep5です。今回はヒストグラムを作成します。

ソースコード

# PNGデバイスを開く
png("histogram_plot.png")

# ベクトルの作成
data <- c(12, 2, 5, 8, 7, 10, 3, 6, 9, 4, 11, 1, 4, 7, 6, 9, 2, 5, 8, 3)

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

# フォントの設定
par(family = "HiraginoSans-W3")

# ヒストグラムの作成
hist(data, breaks = 5, col = "blue", main = "ヒストグラム", xlab = "値", ylab = "頻度")

# PNGデバイスを閉じる
dev.off()

image.png

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?