0 votes
23 views

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

x <- 1:5
x[NA]

R programming interview and answers

in Technology by (187k points)

1 Answer

0 votes

 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].

by (187k points)

Related questions

0 votes
1 answer 13 views
0 votes
1 answer 24 views
0 votes
1 answer 23 views
0 votes
1 answer 22 views
22 views asked Oct 16, 2020 in Technology by JackTerrance (187k points)
0 votes
1 answer 22 views
0 votes
1 answer 12 views
12 views asked Nov 26, 2020 in Technology by JackTerrance (187k points)
...