WorksheetsR Programming Assessment
Total questions: 30
Worksheet time: 16mins
R runs on the ____________ operating system.
Linux
Windows
Ubuntu
Any operating system
You can download “base” R system from _________
A
B
CRAN
D
What will be the output of the following R code?
> x <- 6
> class(x)
“integer”
“numeric”
“real”
“imaginary”
R was named partly after the first names of____R authors?
One
Two
Three
Four
CRAN stands for comprehensive R Artificial Network
True
False
(a) function is used to read data from console or a text file
Which of the following graph can be used for simple summarization of data?
Scatterplot
Barplot
Overlaying
None of these
What is the primary purpose of the R programming language?
Web development
Mobile app development
Statistical analysis
Game development
Which of the following is a popular package for data visualization in R?
dplyr
pandas
ggplot2
numpy
What is the Comprehensive R Archive Network (CRAN) used for?
Hosting R packages
Running R programs
Storing R scripts
Debugging R code
What is the difference between `=` and `<-` in R?
`=` is used for assignment, `<-` is used for printing
`=` is used for printing, `<-` is used for assignment
`=` is used for both assignment and printing
There is no difference between the two
How do you create a vector in R?
`x=c(1,2,3)`
`x=[1,2,3]`
`x={1,2,3}`
`x=(1,2,3)`
What is the purpose of the `%>%` operator in R?
To assign a value to a variable
To pipe output from one function to another
To print a message
To create a new function
Which function is used to create a data frame in R?
rbind()
cbind()
data.frame()
str()
Which function is used to add a row to a data frame?
cbind()
rbind()
merge()
append()
What does names(df) return in R?
Row values
Column names
Data summary
Structure of data frame
What symbol is used to access specific rows and columns of a data frame?
{}
[]
()
<>
Which function is used to combine two data frames by adding new columns?
rbind()
cbind()
merge()
append()
Which function gives a statistical summary of a data frame like mean and median?
summary(df)
str(df)
names(df)
class(df)
In an R data frame, which function would you use to display summary statistics such as mean, median, and min/max?
str()
describe()
summary()
analyze()
Considered as heterogeneous data structure where it contains elements in different data types.
Vector
List
Data Frames
Matrices
If a command is not complete at the end of a line, R will give a different prompt, by default it is:
-
+
>
*
Which of the following statements is correct when we create R functions?
Function arguments are passed by reference
None of the mentioned
What is the main difference between a population and a sample?
A sample includes only individuals with specific characteristics, while a population includes all individuals.
A population is always larger than a sample.
A population is a random subset of individuals while a sample is the entire set of individuals.
A population includes all individuals while a sample includes only a portion.
What is the purpose of statistical inference?
To make predictions about future events
To describe the distribution of a single variable
To draw causal relationships between variables
To make generalizations about a population based on a sample
A data analyst is working with a dataset that contains the number of hours per week that a group of employee’s work. Which of the following measures of central tendency is most appropriate to use in this scenario?
Mean
Median
Mode
Range
A company is analyzing the distribution of salaries among its employees. Which of the following visualizations would be most appropriate to use in this scenario?
Bar chart
Scatter plot
Box plot
Histogram
An insurance company is analyzing the ages of its policyholders. Which of the following visualizations would be most appropriate to use in this scenario?
Bar chart
Scatter plot
Box plot
Histogram
Which function in R is used to create a boxplot using the ggplot2 package?
geom-plot()
geom-boxplot()
geom_plot()
geom_boxplot()
Once we created our database folder in any location in our machine, what function we use to set our working directory to where the database will be saved?
setwd()
set.choose()
wd()
None of the mentioned
