R Language MCQs Test 33

Test your R programming expertise with this 20-question MCQ quiz! R Language MCQs Test designed for both learners and professionals, this quiz covers essential topics like data wrangling with dplyr (group_by, summarize, pipes), string manipulation, lubridate, tidymodels, and predictive modeling. Perfect for preparing for data scientist job interviews, brushing up on core R concepts, and mastering the tidyverse ecosystem. Let us start with the R Language MCQs Test now.

Online R Language MCQs Test

Online R Language Programming Quiz with Answers

1. What is the main similarity between the summarize() and group_by() functions?

 
 
 
 

2. You’ve still got this same messy data:
my_strings<-c(
"xyztiger",
" i33tiger",
"898natiger "
)

You want to use a function to take this data and create a column of data that looks like this:

“tiger”
“tiger”
“tiger”
What is the correct function?

 
 
 
 

3. You have a variable called “Status” that contains a status code in the format “error_type-severity_level”, for example “10-07”, and you want to reformat the column so that the “error_type” and “severity_level” are in different columns. What is the correct function to do this?

 
 
 
 

4. When grouping data and calculating the mean of each group as part of your exploratory data analysis, you typically use the group_by() function with which other function?

 
 
 
 

5. Which of the following can you accomplish using the spread() function?

 
 
 
 

6. You’ve got some messy data that looks like this:
my_strings<-c(
"xyztiger",
" i33tiger",
"898natiger "
)

You want to use a function to do a logical test for whether the character string “tiger” is present in any of the items in this vector. What is the correct function?

 
 
 
 

7. Say you want to split a character vector and split the strings, so you have a matrix with two columns, splitting the string as indicated. Your character vector looks like this:
my_strings<-c(
"paper_store1",
"pens_store1",
"pencils_store1"
)
You want to split the strings at the underscore. What function do you use?

 
 
 
 

8. Which functions do you use together to correct data types in all columns of your dataset?

 
 
 
 

9. Assume you have a dataset called “new_dataset”, two predictor variables called X and Y, and a target variable called Z, and you want to fit a multiple linear regression model. Which command should you use?

 
 
 
 

10. Assume you have a dataset called “new_dataset”, a predictor variable called X, and a target called Y, and you want to fit a simple linear regression model. Which command should you use?

 
 
 
 

11. You have a character vector that looks like this:
my_dates<-c(
“05-28-1984”,
“07-15-1981”,
“9-12-1986”,
“1-15-1982”)
You want to extract the year values from this vector, using the tools in lubridate. Which is correct?

 
 
 
 

12. When using the predict() function in R, what is the default confidence level?

 
 
 
 

13. What’s the point of using group_by()?

 
 
 
 

14. Which function can you use to read a text file that uses the “%” character as a delimiter?

 
 
 
 

15. Which tidymodels function do you use to create the grid for a grid search?

 
 
 
 

16. What is the purpose of the pipe (%>%) operator?

 
 
 
 

17. Let’s say you want to calculate how many days passed from 14 July, 1789 until 1 December 1941. How can you calculate that?

 
 
 
 

18. How can the factor() function be used to map R onto a relational database management system (RDBMS)?

 
 
 
 

19. What is the result of the following statement?

sub_airline %>% map(~sum(is.na(.)))

 
 
 
 

20. You are checking your data using the glimpse() function before beginning your analysis, and determine that the data type of a variable called TimeStamp is in a character format. What should you do next?

 
 
 
 

Question 1 of 20

Online R Language MCQs Test with Answers

  • What’s the point of using group_by()?
  • Which tidymodels function do you use to create the grid for a grid search?
  • What is the purpose of the pipe (%>%) operator?
  • You are checking your data using the glimpse() function before beginning your analysis, and determine that the data type of a variable called TimeStamp is in a character format. What should you do next?
  • How can the factor() function be used to map R onto a relational database management system (RDBMS)?
  • Which function can you use to read a text file that uses the “%” character as a delimiter?
  • What is the main similarity between the summarize() and group_by() functions?
  • What is the result of the following statement?
    sub_airline %>% map(~sum(is.na(.)))
  • Which functions do you use together to correct data types in all columns of your dataset?
  • You have a variable called “Status” that contains a status code in the format “error_type-severity_level”, for example “10-07”, and you want to reformat the column so that the “error_type” and “severity_level” are in different columns. What is the correct function to do this?
  • Which of the following can you accomplish using the spread() function?
  • When grouping data and calculating the mean of each group as part of your exploratory data analysis, you typically use the group_by() function with which other function?
  • Assume you have a dataset called “new_dataset”, a predictor variable called X, and a target called Y, and you want to fit a simple linear regression model. Which command should you use?
  • When using the predict() function in R, what is the default confidence level?
  • Assume you have a dataset called “new_dataset”, two predictor variables called X and Y, and a target variable called Z, and you want to fit a multiple linear regression model. Which command should you use?
  • You’ve got some messy data that looks like this:
    my_strings<-c( “xyztiger”, ” i33tiger”, “898natiger ” )
    You want to use a function to do a logical test for whether the character string “tiger” is present in any of the items in this vector. What is the correct function?
  • You’ve still got this same messy data:
    my_strings<-c( “xyztiger”, ” i33tiger”, “898natiger ” )
    You want to use a function to take this data and create a column of data that looks like this:
    “tiger”
    “tiger”
    “tiger”
    What is the correct function?
  • Say you want to split a character vector and split the strings, so you have a matrix with two columns, splitting the string as indicated. Your character vector looks like
    this: my_strings<-c( “paper_store1”, “pens_store1”, “pencils_store1”)
    You want to split the strings at the underscore. What function do you use?
  • You have a character vector that looks like this:
    my_dates<-c( “05-28-1984”, “07-15-1981”, “9-12-1986”, “1-15-1982”)
    You want to extract the year values from this vector, using the tools in lubridate. Which is correct?
  • Let’s say you want to calculate how many days passed from 14 July, 1789 until 1 December 1941. How can you calculate that?

Try Online Correlation Regression Quiz

Leave a Reply

Discover more from R Programming FAQs

Subscribe now to keep reading and get access to the full archive.

Continue reading