in Technology by

Why do we obtain five missing values from the following lines of code?

x <- 1:5
x[NA]

R programming interview and answers

1 Answer

0 votes
by

 NA is a logical type object and the logical vectors are reused to the equal length shared between vector and its subset. For example, x[NA] when iterated five times becomes x[NA, NA, NA, NA, NA].

Related questions

0 votes
    Which of the following finds the maximum value in the vector x, exclude missing values? (a) rm(x) (b) ... Regression of R Programming Select the correct answer from above options...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    Numerical values that describe a trait of the code such as the Lines of Code come under ________. (1)Relative Metrics (2)Absolute Metrics...
asked May 13, 2021 in Technology by JackTerrance
0 votes
    How to replace the values of NA with zeros in some column and data frame I have? Select the correct answer from above options...
asked Jan 20, 2022 in Education by JackTerrance
0 votes
    How to replace the values of NA with zeros in some column and data frame I have? Select the correct ... Questions, Core Hadoop MCQ,core Hadoop interview questions for experienced...
asked Oct 30, 2021 in Education by JackTerrance
0 votes
    A random variable X takes the values 0,1,2,3,..., with prbability PX(=x)=k(x+1)( 1 5 )x, where k is a ... 16 25 C. 18 25 D. 19 25 Select the correct answer from above options...
asked Nov 16, 2021 in Education by JackTerrance
0 votes
    I have a huge vector which has a couple of NA values, and I'm trying to find the max value in that vector ( ... I can compute the max? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    Predict the output of the following JavaScript code.
    The probability that a student is not a swimmer is 1 5 . Then the probability that out of five students, four are swimmers is: Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    A five digit number is formed but the digits 1,2,3,4,5 without repetition. Find the probability that the number is ... 1 5 D. 6 5 Select the correct answer from above options...
asked Nov 15, 2021 in Education by JackTerrance
0 votes
    A five digit number if formed by the digits 1,2,3,4,5,6 and 8. The probability that the number has even digit ... 2 7 D. none of these Select the correct answer from above options...
asked Nov 15, 2021 in Education by JackTerrance
0 votes
    Box 1 contains three cards bearing numbers 1, 2, 3; box 2 contains five cards bearing numbers 1, 2, 3,4, 5; and box ... D. `(7)/(105)` Select the correct answer from above options...
asked Nov 13, 2021 in Education by JackTerrance
...