FBISE, NCP & NBF-aligned resources for Classes 9–12
Browse by Class
Browse by Type
Computer Chapter 4 : Topic 3.6
Creating Basic Plots in RStudio
1 / 10
Which $\mathbf{R}$ command correctly creates a scatter plot using vectors $\mathbf{x}$ and $\mathbf{y}$ in RStudio?
Reasoning: $\mathbf{plot(x,\ y)}$ creates a basic scatter plot showing the relationship between two vectors.
2 / 10
Which argument changes the plot title when using the basic plot function in RStudio software?
Reasoning: The $\mathbf{main}$ argument specifies the main title displayed above a plot.
3 / 10
Which $\mathbf{R}$ code correctly creates a line plot from $\mathbf{x}$ and $\mathbf{y}$ values in RStudio?
Reasoning: Setting $\mathbf{typ}\mathbf{e = "l"}$ tells $\mathbf{plot()}$ to connect data values using lines.
4 / 10
Which plotting argument changes point symbols in a basic scatter plot created with RStudio software?
Reasoning: The $\mathbf{pch}$ argument controls the shape or plotting symbol used for data points.
5 / 10
Which $\mathbf{R}$ command correctly creates a histogram for numeric data values stored in vector scores?
Reasoning: $\mathbf{hist()}$ groups numerical values into intervals and displays their frequencies as a histogram.
6 / 10
Which argument sets the $\mathbf{x}$-axis label in a basic $\mathbf{R}$ plot created using plot function?
Reasoning: The $\mathbf{xlab}$ argument specifies the descriptive label displayed along the horizontal axis.
7 / 10
Which $\mathbf{R}$ command correctly creates a bar chart from numeric values stored in vector sales?
Reasoning: $\mathbf{barplot()}$ represents supplied values using rectangular bars for easy visual comparison.
8 / 10
Which argument changes plotted point colors in a basic scatter plot created using RStudio software?
Reasoning: The $\mathbf{col}$ argument controls the color of points, lines, or other plotted elements.
9 / 10
Which $\mathbf{R}$ command correctly adds a horizontal reference line at $\mathbf{y}$ equals five on an existing plot in RStudio software?
Reasoning: $\mathbf{abline(h = 5)}$ adds a horizontal line at the $\mathbf{y}$-coordinate equal to $\mathbf{5}$.
10 / 10
Which $\mathbf{R}$ code correctly creates a boxplot for data stored in vector marks using RStudio?
Reasoning: $\mathbf{boxplot()}$ displays the median, quartiles, spread, and possible outliers of numerical data.
Your score is
Restart quiz