Sampling in R Language: Important MCQs 10

The post is about Sampling in R Language. There are 20 multiple-choice questions from the sampling, ggplot2 package, and R language basics too. Let us start with the Quiz sampling in R Language.

R Language Online Quiz with Answers

1. A data analyst is working with a data frame called “salary_data”. They want to create a new column named “total_wages” that adds together data in the “standard_wages” and “overtime_wages” columns. What R code lets the analyst create the “total_wages” column?

 
 
 
 

2. In ggplot2, what function do you use to map variables in your data to visual features of your plot?

 
 
 
 

3. Who introduced tidyverse to “share an underlying design philosophy, grammar, and data structures, of tidy data?

 
 
 
 

4. What is the class of the object defined by the expression x <- c(4, "a", TRUE)?

 
 
 
 

5. In ggplot2, which of the following concepts refers to the shape, color, and size of data points in a plot?

 
 
 
 

6. We obtain the 10000 random sample of size 6 under SRSWOR using the following population (111, 158, 122, 193, 111, 148, 112, 128, 113, 151, 185, 200, 199, 121, 115, 114) which is the R command for repeating this procedure 150 times?

 
 
 
 

7. A data analyst is considering using tibbles instead of basic data frames. What are some of the limitations of tibbles?

 
 
 
 

8. Which is the R command for selecting a sample of size 3 from the population y<- c(11, 150, 121, 192, 233, 129, 117, 186, 129, 189, 159)

 
 
 
 

9. Which of these dplyr verbs can be used to retrieve columns of a dataset?

 
 
 
 

10. For the following population y<- c(1,2,3,4,5), what will be the R command for finding variance?

 
 
 
 

11. A data analyst creates a plot for visualization. The analyst wants to add a caption to the plot to help communicate important information. What function could the analyst use?

 
 
 
 

12. Which of the following functions lets you display smaller groups, or subsets, of your data?

 
 
 
 

13. A data analyst is working with a data frame named “stores”. It has separate columns for city (“city”) and state (“state”). The analyst wants to combine the two columns into a single column named “location”, with the “city” and “state” separated by a comma. What R code lets the analyst create the location column?

 
 
 
 

14. For the following population x<-c(1,2,3,4,5)what will be the R command for finding mean?

 
 
 
 

15. What is the R command for generating bi-variate normal distribution

 
 
 
 

16. A data analyst creates a scatterplot with a lot of data points. It is difficult for the analyst to distinguish the individual points on the plot because they overlap. What function could the analyst use to make the points easier to find?

 
 
 
 

17. Suppose, I have a vector x <- c(3, 6, 1, 19, 12, 8)and I want to set all elements of this vector that are less than 6 to be equal to zero. What R code achieves this?

 
 
 
 

18. A data analyst is working with a data frame named cars. The analyst notices that all the column names in the data frame are capitalized. What R code lets the analyst change all the column names to lowercase?

 
 
 
 

19. Which is the R command for selecting a sample of size 6 from the population yp <- c(111, 159, 121, 198, 120, 136, 14, 129, 17, 115, 186, 119, 121, 153, 143)

 
 
 
 

20. What is the R command for selecting sample of size $n=10$ by probability proportional to size (PPS) with $N=40$.

 
 
 
 

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.

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

R FAQS Logo: Quiz Sampling in R Language

Quiz Sampling in R Language

  • What is the class of the object defined by the expression x <- c(4, “a”, TRUE)?
  • Suppose, I have a vector x <- c(3, 6, 1, 19, 12, 8)and I want to set all elements of this vector that are less than 6 to be equal to zero. What R code achieves this?
  • We obtain the 10000 random sample of size 6 under SRSWOR using the following population (111, 158, 122, 193, 111, 148, 112, 128, 113, 151, 185, 200, 199, 121, 115, 114) which is the R command for repeating this procedure 150 times?
  • Which is the R command for selecting a sample of size 6 from the population yp <- c(111, 159, 121, 198, 120, 136, 14, 129, 17, 115, 186, 119, 121, 153, 143)
  • For the following population y<- c(1,2,3,4,5), what will be the R command for finding variance?
  • For the following population x<-c(1,2,3,4,5)what will be the R command for finding the mean?
  • Which is the R command for selecting a sample of size 3 from the population y<- c(11, 150, 121, 192, 233, 129, 117, 186, 129, 189, 159)
  • What is the R command for generating bi-variate normal distribution
  • What is the R command for selecting a sample of size $n=10$ by probability proportional to size (PPS) with $N=40$?
  • Which of these dplyr verbs can be used to retrieve columns of a dataset?
  • Who introduced tidyverse to “share an underlying design philosophy, grammar, and data structures, of tidy data?
  • A data analyst is working with a data frame called “salary_data”. They want to create a new column named “total_wages” that adds together data in the “standard_wages” and “overtime_wages” columns. What R code lets the analyst create the “total_wages” column?
  • A data analyst is working with a data frame named “stores”. It has separate columns for city (“city”) and state (“state”). The analyst wants to combine the two columns into a single column named “location”, with the “city” and “state” separated by a comma. What R code lets the analyst create the location column?
  • A data analyst is considering using tibbles instead of basic data frames. What are some of the limitations of tibbles?
  • A data analyst is working with a data frame named cars. The analyst notices that all the column names in the data frame are capitalized. What R code lets the analyst change all the column names to lowercase?
  • In ggplot2, what function do you use to map variables in your data to visual features of your plot?
  • In ggplot2, which of the following concepts refers to the shape, color, and size of data points in a plot?
  • Which of the following functions lets you display smaller groups, or subsets, of your data?
  • A data analyst creates a scatterplot with a lot of data points. It is difficult for the analyst to distinguish the individual points on the plot because they overlap. What function could the analyst use to make the points easier to find?
  • A data analyst creates a plot for visualization. The analyst wants to add a caption to the plot to help communicate important information. What function could the analyst use?

Computer MCQs Test Online

SPSS Data Analysis

Important MCQs R Language Quiz 9

The post is about MCQ on R Language Quiz with Answers. The quiz covers the topics related to R Package qqplot, R Studio, and Data.Frame. Let us start with the MCQs R Language Quiz.

Please go to Important MCQs R Language Quiz 9 to view the test

MCQs R Language Quiz

  • Which of the following aesthetic attributes can you map to the data in a scatterplot?
  • What is the role of the x argument in the following code?
    ggplot(data = diamonds) +
    geom_bar(mapping = aes(x = cut))
  • Which of the following are the benefits of adding labels and annotations to your plot?
  • What function can you use to put a text label inside the grid of your plot to call out specific data points?
  • Which of the following are operations you can perform in ggplot2?
  • When creating a plot in ggplot you must set the mapping argument of a function. Which function has the mapping argument?
  • Which ggplot function is used to define the mappings of variables to visual representations of data?
  • Which of the following are the benefits of using ggplot2?
  • What argument of the labs() function can a data analyst use to add text outside of the grid area of a plot?
  • Which statement about the ggsave() function is correct?
  • A data analyst is working with the penguin’s data. The analyst creates a scatterplot with the following code:
    ggplot(data = penguins) +
    geom_point(mapping = aes(x = flipper_length_mm, y = body_mass_g, alpha = species))
  • What does the alpha aesthetic do to the appearance of the points in the plot?
  • The ___________ creates a scatterplot and then adds a small amount of random noise to each point in the plot to make the points easier to find.
  • In R studio, what default options does the Export functionality of the Plots tab give for exporting plots?
  • Which of the following are operations you can perform in ggplot2?
  • In ggplot2, you use the plus sign (+) to add a layer to your plot.
  • Which of the following is NOT a valid data structure in R?
  • What is the purpose of the rep() function in R?
  • Which package is associated with data visualization in R?
  • What does the data.frame function do in R?
  • Data frames can be converted to a matrix by calling data.
Frequently Asked Questions About MCQs R Language Quiz

https://itfeature.com

https://gmstat.com

Important R Language MCQs ggplot2 with Answers 8

The quiz “R Language MCQS ggplot2” will help you check your ability to execute some basic operations on objects in the R language, and it will also help you understand some basic concepts. This quiz may also improve your computational understanding.

Please go to Important R Language MCQs ggplot2 with Answers 8 to view the test

Frequently Asked Questions About R Language MCQs ggplot2

R Language MCQs ggplot2 Function

  • What is the class of the object defined by the expression? x <- c(4,5,10)?  
  • In R the following are all atomic data types EXCEPT:
  • For the population y<-c(1,2,3,4,5), write the R command to find the mean.
  • For the population y<-c(1,2,3,4,5), write the R command to find the median.
  • Let us have 1000 random samples of size 6 under SRSWOR using the following population (111, 150, 121, 198, 112, 136, 114, 129, 117, 115, 186, 110, 121, 115, 114) which is the R command for repeating this procedure 1500 times?
  • Which is the R command for obtaining 1000 random numbers through normal distribution with mean 0 and variance 1?
  • How sampling with and without replacement can be done using R?
  • Write the R commands for generating 700 random variables from normal distribution by using the following information: Mean = 14, SD = 3, n = 5, k = 2000.
  • Suppose you want to simulate a coin toss 20 times in R. Write the command.
  • When programming in R, what is a pipe used as an alternative for?
  • Which of the following are standards of tidy data?
  • Which summary functions can you use to preview data frames in R Language?
  • Which R function can be used to make changes to a data frame?
  • Why are tibbles a useful variation of data frames?
  • Data analysts are cleaning their data in R.
  • They want to be sure that their column names are unique and consistent to avoid any errors in their analysis. What R function can they use to do this automatically?
  • Data analysts are working with customer information from their company’s sales data. The first and last names are in separate columns, but they want to create one column with both names instead. Which of the following functions can they use?
  • A data scientist is trying to print a data frame but when you print the data frame to the console output produces too many rows and columns to be readable. What could they use instead of a data frame to make printing more readable?
  • A data analyst is working with the penguin’s data. They write the following code: penguins %>% The variable species includes three penguin species: Adelie, Chinstrap, and Gentoo. What code chunk does the analyst add to create a data frame that only includes the Gentoo species?
  • You are cleaning a data frame with improperly formatted column names. To clean the data frame you want to use the clean_names() function. Which column names will be changed using the clean_names() with default parameters?
  • In ggplot2, an ———- is a visual property of an object in your plot.

R Language MCQs 2

Computer MCQs Online Test