Question
Quiz 3 Which of the following statements are TRUE about unique() function? unique() removes duplicates based on all the columns in the argument. Usage of
Quiz 3
Which of the following statements are TRUE about unique() function?
- unique() removes duplicates based on all the columns in the argument.
- Usage of unique() should be avoided as far as possible.
- Both of the above are true.
- None of the above
Which of the following line of code will always extract exactly one element stored in dat?
- dat[1, 2]
- unique( dat )
- unique( dat[ ,2] )
- dat[1:3, ]
- None of the above
Which R code is used to permanently change the dataset dat?
- unique( dat[, 2] )
- order( dat )
- head( dat )
- dat[1, 2] <- 5
- None of the above
Assuming dat has 100 observations and five variables, which R code would have the effect of changing the original data from the dataset dat?
- dat[1, 2] <- NA
- dat[ !is.na(dat[ , 1]), 1] <- NA
- Both of the above are true.
- None of the above
Assuming dat has 100 observations and five variables, with R code, how do you select the third column from the dataset named dat?
- dat[ , 3]
- dat[1, 3]
- dat[3, ]
- dat[3, 1]
- None of the above
Assuming dat has 100 observations and five variables, which R code would output only two columns from a dataset named dat?
- dat[1:2, ]
- dat[, 1:2]
- Both of the above are true.
- dat[ c(1, 2), ]
- None of the above
With R, how do you output all the observations from a dataset named dat where the values of the second column is greater than 3?
- dat[ , 2] > 3
- dat[2, ] > 3
- dat[ dat[ , 2] > 3, ]
- None of the above
The logical operator "|" displays an entry if ANY conditions listed are TRUE. The logical operator "&" displays an entry if ALL of the conditions listed are TRUE
- True
- False
Which R code would be used to sort all the elements of the first column of the dataset dat?
- order( dat[ , 1] )
- order( dat$1 )
- dat[ order, 1 ]
- dat[ order(), 1]
- None of the above
With R, how can you replace the entries where the value is 3 with NA in a dataset named dat?
- dat[ dat == 3 ] <- NA
- dat[ is.na(), 3]
- is.na( dat == 3 )
- dat <- 3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started