Search Header Logo

522270 - Quiz1 (Class01-02)

Authored by Thitinan Pholsook

Computers

University

Used 6+ times

522270 - Quiz1 (Class01-02)
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

DRAG AND DROP QUESTION

45 sec • 1 pt

หากต้องการให้ได้ผลลัพธ์ดังนี้

2 5 8 11 14 17 20 23

ควรเขียน R script อย่างไร?

seq(from =​​​​ (a)   , to =​ (b)   , by =​ (c)   )

2
25
3
26
26
0
4

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

จาก R script ดังแสดงด้านล่าง

a <- rep(c(1, 3, 5, 7, 9), each=3)

ผลลัพธ์ a[5] ในข้อใดถูกต้องที่สุด

1

3

5

7

9

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

จาก R script ที่แสดงด้านล่าง

matA <- matrix(1:15, nrow = 3, ncol = 5)

matB <- matA*2

matC <- matB[-2,-1]

ผลลัพธ์ของ matC ในข้อใดถูกต้องที่สุด?

Media Image
Media Image
Media Image

ผิดทุกข้อ

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

จาก R script ที่แสดงในภาพ

ผลลัพธ์ในข้อใดถูกต้องที่สุด?

[1] 1

[1] 2

[1] 4

[1] 6

[1] 8

[1] 10

[1] 1

[1] 3

[1] 5

[1] 7

[1] 9

[1] 1

[1] 2

[1] 4

[1] 8

[1] 1

[1] 4

5.

FILL IN THE BLANK QUESTION

45 sec • 1 pt

Media Image

จาก R script ที่แสดงดังภาพ

ผลลัพธ์ของ z คือ

6.

DRAG AND DROP QUESTION

1 min • 1 pt

จากข้อมูล

temp <- list(c(3,7,5,6,-1), c(6,9,10,4,5), c(2,8,3,-2,3), c(1,4,-5,2,2), c(0,7,-1,4,2), c(-3,5,7,-4,4), c(3,-3,1,4,1))

หากต้องการผลลัพธ์ตามด้านล่าง

[1] -1 4 -2 -5 -1 -4 -3

ควรเขียน R script อย่างไร

​ (a)   (temp, ​ (b)   )

sapply
min
lapply
max
mean
tapply

7.

FILL IN THE BLANK QUESTION

1 min • 1 pt

จาก R script ด้านล่าง

cities <- c("Bangkok", "Nakhon Ratchasima", "Chiang Rai")

sum_cities <- sum(unlist(lapply(cities, nchar)))

ผลลัพธ์ของ sum_cities คือ

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?