Control Structures In R Programming - Study Mode
[#136] What will be the output of the following R code? > f <- function(elt) {
+ elt[, 1]
+ }
> lapply(x, f)
Correct Answer
(A) $a [1] 1 2 $b [1] 1 2 3
[#137] Which function basically finds the intersection between two different sets of data?
Correct Answer
(B) Merge
[#138] . . . . . . . . can contain heterogeneous inputs.
Correct Answer
(B) Data Frames
[#139] . . . . . . . . is one type of the simplest machine learning classification algorithms that is a subset of supervised learning based on lazy learning.
Correct Answer
(A) K-Nearest Neighbour
[#140] hat will be the output of the following R code? > centre <- function(x, type) {
+ switch(type,
+ mean = mean(x),
+ median = median(x),
+ trimmed = mean(x, trim = .1))
+ }
> x <- rcauchy(10)
> centre(x, "mean")
Correct Answer
(D) gives mean with values depending on rcauchy values