R Programming Quiz Questions and Answers 18

This post is about “R Programming Quiz Questions and Answers”. There are 20 multiple-choice type questions from R programming covering topics related to the output of different R commands, R console, matrices, data frames, factors, vectors, R objects, and different operations on R objects. Let us start with R Programming Quiz Questions and Answers.

Online Multiple Choice Questions about R Programming Language

1. What is the output of 1:4 + 4:1

 
 
 
 

2. What will be the output of the following
X <- factor(c(“yes”, “yes”, “yes”, “no”, “yes”, “no”, “no”)
table(X)

 
 
 
 

3. What would be the output of the following code?
x <- 1:4
y <- 6:9
z <- x + y
print(z)

 
 
 
 

4. The output of seq(10, 1, -2) is

 
 
 
 

5. In R, object name cannot start with

 
 
 
 

6. Which command will create a matrix of the first 9 numbers in 3 rows and 3 columns?

 
 
 
 

7. The following command will find the 60th percentile for the variable $disp$

 
 
 
 

8. What will be the output of the following lines of code?
x <- 31
if (x %% 2 == 0){
print("X is even")
}else {
print("X is odd")
}

 
 
 
 

9. R console is a tool that is used to write (insert) standard

 
 
 
 

10. What will be the output of the following
x <- vector("numeric", length = 10); print(x)

 
 
 
 

11. The Vectors, data frames, or matrices containing decimal values can be converted to integers using

 
 
 
 

12. The output of the seq(1, 10, 2) is

 
 
 
 

13. What will be the output of the following code
X <- factor(c("m", "m", "m", "f", "m", "f", "f")
table(X)

 
 
 
 

14. Which of the following function can be used to create a vector having repeated values

 
 
 
 

15. What is the data type of vector $a$ if a <- c(1, “m”, FALSE)

 
 
 
 

16. To perform one-way Analysis of variance, one can use function

 
 
 
 

17. The multiplication of two matrices $A$ and $B$ can be performed in R using the operator

 
 
 
 

18. All columns in a matrix must have the

 
 
 
 

19. When we compare two vectors element by element the resultant outcome is a

 
 
 
 

20. What would be the output of 1:5 + 5:1.

 
 
 
 

R FAQS R Programming Quiz Questions and Answers

R Programming Quiz Questions and Answers

  • The output of seq(10, 1, -2) is
  • What will be the output of the following lines of code? x <- 31 if (x %% 2 == 0){ print(“X is even”) }else { print(“X is odd”) }
  • What would be the output of 1:5 + 5:1.
  • What will be the output of the following x <- vector(“numeric”, length = 10); print(x)
  • What would be the output of the following code? x <- 1:4 y <- 6:9 z <- x + y print(z)
  • What will be the output of the following X <- factor(c(“yes”, “yes”, “yes”, “no”, “yes”, “no”, “no”) table(X)
  • The output of the seq(1, 10, 2) is
  • What will be the output of the following code X <- factor(c(“m”, “m”, “m”, “f”, “m”, “f”, “f”) table(X)
  • What is the output of 1:4 + 4:1
  • R console is a tool that is used to write (insert) standard
  • The following command will find the 60th percentile for the variable $disp$
  • The multiplication of two matrices $A$ and $B$ can be performed in R using the operator
  • Which command will create a matrix of the first 9 numbers in 3 rows and 3 columns?
  • When we compare two vectors element by element the resultant outcome is a
  • Which of the following function can be used to create a vector having repeated values
  • The Vectors, data frames, or matrices containing decimal values can be converted to integers using
  • What is the data type of vector $a$ if a <- c(1, “m”, FALSE)
  • All columns in a matrix must have the
  • To perform one-way Analysis of variance, one can use function
  • In R, object name cannot start with
R Programming Quiz Questions and Answers

https://itfeature.com, https://gmstat.com

Best MCQs Graph Plotting in R 17

The post is about MCQs Graph Plotting in R Language. There are 20 multiple-choice questions. The quiz covers the topics related to graphics devices in R Language, base and lattice graphics systems in R, the ggplot2 function, and parameters of different plot functions. Let us start with MCQs Graph Plotting in R Language.

Please go to Best MCQs Graph Plotting in R 17 to view the test

MCQs Graph Plotting in R

  • Which of the following is an example of a valid graphics device in R?
  • Which of the following is the example of a vector graphics device in R?
  • Bitmapped file formats can be most useful for
  • Which of the following functions is typically used to add elements to a plot in the base graphics system?
  • Which function opens the screen graphics device on Windows?
  • What does the ‘pch’ option to par() control?
  • If I want to save a plot to a PDF file, which of the following is the correct way of doing that
  • Which function opens the screen graphics device for the Mac?
  • What does the gg in ggplot2 stand for?
  • Under the lattice graphics system, what do the primary plotting functions like xyplot() and bwplot() return?
  • Which of the following is a basic workhorse function of ggplot2?
  • Which types of the plot does qplot plot?
  • Transparency is determined by which parameter of the rgb function?
  • Which of the following is an R package that provides color palettes for sequential, categorical, and diverging data?
  • The following code does NOT result in a plot appearing on the screen device.
    library(lattice)
    library(datasets)
    data(airquality)
    p <- xyplot(Ozone ~ Wind | factor(Month), data = airquality)
    Which of the following is an explanation for why no plot appears?
  • In the lattice system, which of the following functions can be used to finely control the appearance of all lattice plots?
  • What is ggplot2 an implementation of?
  • What is a geom in the ggplot2 system?
  • When I run the following code I get an error: I was expecting a scatterplot of ‘votes’ and ‘rating’ to appear. What’s the problem?
  • The following code creates a scatterplot of ‘votes’ and ‘rating’ from the movies dataset in the ggplot2 package. After loading the ggplot2 package with the library() function, I can run qplot(votes, rating, data = movies)
    How can I modify the code above to add a smoother to the scatterplot?
Learn R Language and FAQS, MCQs Graph plotting in R

https://itfeature.com, https://gmstat.com

Important MCQs On dplyr in R 16

The post is about multiple-choice questions about the package dplyr in R Language. There are 20 MCQs about the package and its use. Let us start with the Quiz on dplyr in R Language.

Please go to Important MCQs On dplyr in R 16 to view the test

MCQs dplyr in R Language

  • What is the function of the dplyr verb Filter?
  • What is the function of the dplyr verb Select?
  • What is the function of the dplyr verb Group By?
  • How does Summarise work?
  • What does the dplyr verb mutate do?
  • The dplyr verb Arrange is responsible for what action?
  • The dplyr verb ‘Filter‘ does what to a data frame?
  • The dplyr verb ‘Select‘ does?
  • What does the dplyr verb ‘Group By‘ do?
  • What does the dplyr verb ‘Arrange‘ do?
  • What does the dplyr verb ‘Mutate‘ do?
  • What symbol is used in dplyr that holds verbs together in a single phrase?
  • Example tools for reproducible report writing are:
  • Reproducibility tools for reports like knitr help with:
  • What is the purpose of the distinct() function in dplyr?
  • In dplyr, what is the purpose of the %>% operator (known as pipe operator)
  • ———– function is similar to the existing subset() function in R but is quite a bit faster.
  • What is the purpose of ungroup() function in dplyr?
  • In dplyr, what does the slice() function do?
  • How can a new column/variable (total_price) be created in dplyr with the sum of two existing columns/variables price1 and price2?

An Introduction to dplyr Package

The dplyr package is used for data manipulation and transformation. It gives a set of functions that make it easy to perform common data manipulation tasks, which include (1) filtering, (2) grouping, (3) summarizing, (4) arranging, and (5) joining data frames.

The package is part of the tidyverse, a collection of R packages designed to work together seamlessly for data analysis and visualization.

Some key functions available in dplyr R Package include:

  • filter(): Used to subset rows based on specified conditions.
  • select(): Used to choose specific columns from a data frame.
  • arrange(): Used to reorder rows based on one or more columns.
  • mutate(): Used to create new columns or modify existing ones.
  • group_by(): Used to group data by one or more variables.
  • summarize(): Used to compute summary statistics for groups of data.
  • join(): Used to merge data frames based on common keys.
dplyr in R Language

The dplyr package provides a powerful and efficient toolkit for data manipulation in R.

R FAQS Logo: dplyr in R Language

https://itfeature.com, https://gmstat.com