Questions
COMM_V 205 101 102 103 2025W1 Breakout Group (BG) 15
Multiple dropdown selections
Start a fresh of R session by launching RStudio. If RStudio is already open, you can start a fresh R session by going to menu item: Session > Restart R. Note in a fresh R session, there is no library loaded. So, if you execute the following, you will be given an error. df0 <- tibble(X = c("a","b","c"), Y = c(101,102,103), Z = c(10,20,30) Remember tibble function are from tibble library which comes with tidyverse. We often load tidyverse for convenience. If we do load tidyverse by calling library(tidyverse) Links to an external site. , it will load the core tidyverse packages. However, we do not have to load a "mega" library like tidyverse if we are going to use only one or two functions from libraries included in tidyverse. Instead, you can load the specific library, whose function(s) you want to use. In the above case, you only need to load tibble library. library(tibble) df0 <- tibble(X = c("a","b","c"), Y = c(101,102,103), Z = c(10,20,30)) Since tibble is loaded, df0 was successfully created. Now, you wanted to convert the data type of the Y column to character. Here is the code, part of which is redacted: library(XXX) df1 <- df0 %>% mutate( XXX = XXX(Y)) Complete the code below so that df1 is successfully created. library( [ Select ] readr dplyr babynames sauder ) df1 <- df0 %>% mutate( [ Select ] X Y Z = [ Select ] is.character as.character is.numeric as.numeric (Y))
View Explanation
Verified Answer
Please login to view
Step-by-Step Analysis
To approach this problem, I’ll walk through what each part of the code is doing and how the selections fit into the intended outcome.
First, the code snippet shows: library(XXX) followed by df1 <- df0 %>% mutate( XXX = XXX(Y)). The goal is to convert the data type of the Y column to character in the resulting data frame df1.
Option group 1: Which library to load with library(XXX)?
- dplyr: This is the correct choice. The dplyr package provides the pipe operator %>% and the mutate function, which are used in the subsequent code. Loading tidyverse would also work, but the instructio......Login to view full explanationLog in for full answers
We've collected over 50,000 authentic exam questions and detailed explanations from around the globe. Log in now and get instant access to the answers!
Similar Questions
This function in the library of Pandas allows you to manipulate data and create new variables (please choose all the correct answers, one or more):
Question at position 17 ________ is a set of commands used to update and query a database.DDL DML DPL DCL
Please create the following data frame: library(tidyverse)student <- tibble( sid = c(66666,66666,66666,66666,66666,66666,22222,22222,22222,22222,22222, 11111,11111,11111,11111,11111,44444,44444,44444,44444,44444, 44444, 55555,55555,55555,55555,55555,55555, 33333,33333,33333,33333,33333,33333, 77777), course = c("COMM101", "COMM102", "COMM103", "COMM201", "COMM204","COMM205", "COMM101", "COMM102", "COMM103", "COMM201","COMM204", "COMM101", "COMM102", "COMM103", "COMM201", "COMM205", "COMM101", "COMM102", "COMM103", "COMM201","COMM204", "COMM205", "COMM101", "COMM102", "COMM103","COMM201", "COMM204", "COMM205", "COMM101", "COMM102", "COMM103", "COMM201", "COMM204","COMM205", "COMM205"), year = c(2016, 2016, 2016, 2017, 2017, 2017, 2016, 2016, 2017, 2017,2017,2016, 2016, 2016, 2017, 2017, 2016, 2016, 2016, 2016, 2017, 2017,2016, 2016, 2016, 2016, 2017, 2017,2016, 2016, 2016, 2017, 2017, 2017, 2017), grade = c(85, 88, 72, 67, 80, 90, 77, 77, 77, 77, 77, 78, 82, 82, 80, 90, 80, 80, 80, 85, 85, 85, 79, 80, 81, 82, 83, 84, 90, 88, 95, 80, 80, 80, 99)) You wanted to find out how many unique students have taken courses in 2016. student %>% filter(year == 2016) %>% XXXX(sid) %>% summarise(XXXX(sid)) The result of your code should look something like this: # A tibble: 1 × 1 XXXXXXXXXX <int> 1 6 Please complete the code below. student %>% filter(year == 2016) %>% [Fill in the blank] (sid) %>% summarise([Fill in the blank] (sid))
Question at position 51 A database is maintained and queried using the data mapping language (DML).TrueFalse
More Practical Tools for Students Powered by AI Study Helper
Making Your Study Simpler
Join us and instantly unlock extensive past papers & exclusive solutions to get a head start on your studies!