wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Tidyverse style guide: good and bad coding examples

Total questions: 11

Worksheet time: 8mins

Name
Class
Date
1.

Wat zijn goede bestandsnamen?

a)

fit_models.R

b)

fit models.R

c)

utility_functions.R

d)

01_explore.R

e)

stuff.r

2.

Wat zijn goede objectnamen?

a)

DayOne

b)

dayone

c)

day_one

d)

day_1

e)

first_day_of_the_month

3.

Waar worden spaties goed gebruikt bij kolomselectie?

a)

x[,1]

b)

x[ ,1]

c)

x[, 1]

d)

x[ , 1]

e)

x [ , 1]

4.

Waar worden spaties goed gebruikt bij het aanroepen van een functie?

a)

mean (x, na.rm = TRUE)

b)

mean( x, na.rm = TRUE )

c)

mean(x, na.rm = TRUE)

d)

mean(x,na.rm=TRUE)

5.

Waar worden spaties goed gebruikt bij infix operators?

a)

height <- (feet * 12) + inches

b)

height<-feet*12+inches

c)

sqrt(x^2 + y^2)

d)

sqrt(x ^ 2 + y ^ 2)

e)

df $ z

6.

Wat is het maximale aantal karakters waaruit een regel code mag bestaan?

a)

50

b)

80

c)

100

d)

150

e)

200

7.

Hoe wijs je een waarde toe aan een object?

a)

x <- 5

b)

x = 5

8.

Waar worden aanhalingstekens goed gebruikt?

a)

"Text"

b)

'Text'

c)

'<a href="http://style.tidyverse.org">A link</a>'

d)

'Text with "quotes"'

e)

'Text with "double" and \'single\' quotes'

9.

Wat zijn goede functienamen?

a)

add_row()

b)

permute()

c)

row_adder()

d)

permutation()

10.

Waar worden pipes goed genoteerd?

a)
b)
c)
d)
11.

Waar wordt het gebruik van ggplot2 goed genoteerd?

a)
b)
c)
d)