in Education by
If a programmer wants the output to be a list then ___________ function is used. (a) Lapply (b) Sapply (c) Vapply (d) Zapply I got this question during an online interview. I want to ask this question from Functions in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Right answer is (b) Sapply The explanation is: sapply() function does the same jobs as lapply() function but returns a vector. We can use a user built-in function into lapply() or sapply(). We create a function named avg to compute the average of the minimum and maximum of the vector.

Related questions

0 votes
    If the programmers want the output to be a data frame or a vector, then ________ function is used. (a) ... Debugging of R Programming Select the correct answer from above options...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    _____________ function is preferred over sapply as vapply allows the programmer to specific the output type. (a) ... of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    ___________ function gives an error message if the desired package cannot be loaded. (a) Dplyr (b) Require (c ... of R Programming Select the correct answer from above options...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    If the function in a console is.matrix(X) returns true then X can be considered as a _______ (a) Matrix ... Debugging of R Programming Select the correct answer from above options...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    A programmer builds a _________ to avoid repeating the same task or reduce complexity. (a) Function (b) Package ... of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    ___________ function is used to apply an expression for a given dataset. (a) This() (b) With() (c) ... and Debugging of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    ___________ can be used for storing the data for long-term. (a) HDLS (b) HDFS (c) HDLSV (d) HSSLV ... and Debugging of R Programming Select the correct answer from above options...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    R Commander is used to ___________ in R. (a) Export data (b) Import data (c) Use data (d) Work on ... and Debugging of R Programming Select the correct answer from above options...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    To get the current date, the _______ function will return a Date object which can be converted to a different ... of R Programming Select the correct answer from above options...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    ____________ function can be used to select the random sample of size n' from a huge dataset. (a) ... Debugging of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    ________ function can be used to add datasets in R provided with the columns in the datasets should be the same ... of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    In a simple linear regression model (One independent variable), If we change the input variable by 1 unit. How ... of R Programming Select the correct answer from above options...
asked Feb 10, 2022 in Education by JackTerrance
0 votes
    _______________ returns TRUE then X can be termed as a matrix data object. (a) is. matrix(X ) (b) is ... and Debugging of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    What will be the output of log (-5.8) when executed on R console? (a) NAN (b) NA (c) Error ... Functions and Debugging of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    What will be the output of runif()? (a) Random number (b) Numbers (c) Character (d) Path generation ... and Debugging of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
...