0
0
R Programmingprogramming~10 mins

Labels and titles in R Programming - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to add a main title to the plot.

R Programming
plot(1:5, 1:5, main=[1])
Drag options to blanks, or click blank then click option'
A"My Plot"
Btitle
Cxlab
Dylab
Attempts:
3 left
💡 Hint
Common Mistakes
Using title instead of a string for the main argument.
Forgetting quotes around the title text.
2fill in blank
medium

Complete the code to add labels to the x and y axes.

R Programming
plot(1:5, 1:5, xlab=[1], ylab=[2])
Drag options to blanks, or click blank then click option'
A"X Axis"
Bmain
Ctitle
Dlabel
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'main' instead of 'xlab' or 'ylab'.
Not using quotes around the label text.
3fill in blank
hard

Fix the error in the code to add a subtitle to the plot.

R Programming
plot(1:5, 1:5, sub=[1])
Drag options to blanks, or click blank then click option'
ASubtitle
Bsub_title
C"Subtitle"
Dsubtitle
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around the subtitle text.
Using incorrect argument names like 'subtitle' or 'sub_title'.
4fill in blank
hard

Fill both blanks to add a main title and axis labels to the plot.

R Programming
plot(1:5, 1:5, main=[1], xlab=[2], ylab=[2])
Drag options to blanks, or click blank then click option'
A"Main Title"
B"X Label"
C"Y Label"
D"Axis Label"
Attempts:
3 left
💡 Hint
Common Mistakes
Using different labels for xlab and ylab when the task wants the same.
Not using quotes around the text.
5fill in blank
hard

Fill all three blanks to add a main title, subtitle, and axis labels to the plot.

R Programming
plot(1:5, 1:5, main=[1], sub=[2], xlab=[3], ylab=[3])
Drag options to blanks, or click blank then click option'
A"Main Title"
B"Subtitle Text"
C"Axis Label"
D"Extra"
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect argument names.
Forgetting quotes around text.
Using different labels for xlab and ylab when the task wants the same.