Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using title instead of a string for the main argument.
Forgetting quotes around the title text.
✗ Incorrect
The 'main' argument sets the main title of the plot. It requires a string, so use quotes around the title text.
2fill in blank
mediumComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'main' instead of 'xlab' or 'ylab'.
Not using quotes around the label text.
✗ Incorrect
The 'xlab' and 'ylab' arguments set the labels for the x and y axes respectively. They need text strings in quotes.
3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around the subtitle text.
Using incorrect argument names like 'subtitle' or 'sub_title'.
✗ Incorrect
The 'sub' argument adds a subtitle and requires a string in quotes. Without quotes, R treats it as a variable name causing an error.
4fill in blank
hardFill 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'
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.
✗ Incorrect
The 'main' argument sets the main title, and 'xlab' and 'ylab' set the axis labels. Here, both axes share the same label.
5fill in blank
hardFill 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'
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.
✗ Incorrect
The 'main' argument sets the main title, 'sub' sets the subtitle, and 'xlab' and 'ylab' set the axis labels. Axis labels are the same here.