in Education by
_____________ function is preferred over sapply as vapply allows the programmer to specific the output type. (a) Lapply (b) Japply (c) Vapply (d) Zapply I got this question at a job interview. This interesting question is from Functions topic in section 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 choice is (c) Vapply Best explanation: Vapply is similar to sapply, but has a pre-specified type of return value, so it can be safer (and sometimes faster) to use. simplify2array() is the utility called from sapply() when simplify is not false and is similarly called from mapply().

Related questions

0 votes
    If a programmer wants the output to be a list then ___________ function is used. (a) Lapply (b) Sapply ... Debugging of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    ________ allows you to insert debugging code into a function a specific places (a) debug() (b) trace() ( ... Debugging of R Programming Select the correct answer from above options...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    _______ allows you to modify the error behavior so that you can browse the function call stack (a) debug() ... of R Programming Select the correct answer from above options...
asked Feb 15, 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
    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
    _____________ will produce a sequential vector c( (1,2,3,4,5,6,7,8,9)). (a) Seq(9) (b) Seq ... Functions and Debugging of R Programming Select the correct answer from above options...
asked Feb 13, 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
    _________ package provides basic functionalities in R environment like arithmetic calculations, input/output. (a) R ... 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
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
    ____________ is one type of the simplest machine learning classification algorithms that is a subset of supervised ... R Programming Select the correct answer from above options...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    Which of the following is used to view dataset in a spreadsheet-type format ? (a) Disp() (b) View() ... Regression of R Programming Select the correct answer from above options...
asked Feb 11, 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
...