1-2. Exercises

Ex 1. λ‹€μŒ λ„μˆ˜ λΆ„ν¬ν‘œμ— 수둝된 λͺ¨λ“  데이터 수치λ₯Ό λ‚˜μ—΄ν•˜λΌ.

x   21 22 23 24 25
f    1  5  6  4  2

[Solution]

21 22 22 22 22 22 23 23 23 23 23 23 24 24 24 24 25 25

Ex 2. λ‹€μŒ λ„μˆ˜ λΆ„ν¬ν‘œμ— 수둝된 λͺ¨λ“  데이터 수치λ₯Ό λ‚˜μ—΄ν•˜λΌ.

x  97 98 99 100 101 102 103 105
f   7  5  2   4   2   2   1   1 

[Solution]

97 97 97 97 97 97 97 98 98 98 98 98 99 99 100 100 100 100 101 101 102 102 103 105

Ex 3. λ‹€μŒμ˜ 데이터 μ„ΈνŠΈμ— λŒ€ν•œ λ„μˆ˜ λΆ„ν¬ν‘œλ₯Ό μž‘μ„±ν•˜λΌ.

22 25 22 27 24 23 26 24 22 24 26

[Solution]

x <- c(22, 25, 22, 27, 24, 23, 26, 24, 22, 24, 26)
table(x)

Ex 4. λ‹€μŒμ˜ 데이터 μ„ΈνŠΈμ— λŒ€ν•œ λ„μˆ˜ λΆ„ν¬ν‘œλ₯Ό μž‘μ„±ν•˜λΌ.

1 5 2 3 5 1 4 4 4 3 2 5 1 3 2 1 1 1 2

[Solution]

x <- c(1, 5, 2, 3, 5, 1, 4, 4, 4, 3, 2, 5, 1, 3, 2, 1, 1, 1, 2)
table(x)

Last updated