题目
COMM_V 205 101 102 103 2025W1 Exam B2 (R) 2025W1 Final - Requires Respondus LockDown Browser
单项选择题
Suppose you have a data frame called df with 10 observations. One of the columns is a character column called ID. The first value of ID is "01", the second is "02", and so forth. The 10th observation for ID is "10". You then run the following code: df %>% mutate(ID_num = as.numeric(ID), ID_new = as.character(ID_num)) %>% filter(ID != ID_new) How many rows are displayed (outputted) in the result?
选项
A.1
B.2
C.5
D.9
E.10
查看解析
标准答案
Please login to view
思路分析
The scenario involves a character column ID with values '01','02', ..., '10', and a dplyr pipeline that creates two new columns before filtering.
Option 1: '1' is used when considering the numeric conversion of '01' to 1 and then back to a character '1'. Since '01' becomes '1' after the numeric round-trip, the comparison ID != ID_new yields '01' != '1', which is TRUE, so that row remains. Therefore this option would not correspond t......Login to view full explanation登录即可查看完整答案
我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!