32.
Body of lapply function is?

function (X, FUN, ...)
{
    FUN <- match.fun(FUN)
    if (!is.vector(X) || is.object(X))
       X <- as.list(X)
    .Internal(lapply(X, FUN))
}

function (X, FUN, ...)
{
    FUN <- match.fun(FUN)
    if (!is.vector(X) | is.object(X))
      X <- as.list(X)
    .Internal(lapply(X, FUN))
}

function (X, FUN, ...)
{
    FUN <- match.fun(FUN)
    if (is.vector(X) || is.object(X))
      X <- as.list(X)
    .Internal(lapply(X, FUN))
}

function (X, FUN, ...)
{
    FUN <- match.fun(FUN)
    if (is.vector(X) || is.object(X))
}

35.
Which of the following R code will print the following result?
[[1]]
[1] 2.263808
[[2]]
[1] 1.314165 9.815635
[[3]]
[1] 3.270137 5.069395 6.814425
[[4]]
[1] 0.9916910 1.1890256 0.5043966 9.2925392

36.
What will be the output of the following R code?
> f <- function(num) {
+ hello <- "Hello, world!\n"
+ for(i in seq_len(num)) {
+                    cat(hello)
+ }
+                    chars <- nchar(hello) * num
+                    chars
+ }
> meaningoflife <- f(3)
> print(meaningoflife)

Read More Section(Control Structures in R Programming)

Each Section contains maximum 100 MCQs question on Control Structures in R Programming. To get more questions visit other sections.