I am constructing a program where I need a to construct a vector of values. These values are constructed from other vectors. A particular vector M has thousands of values, but I need to delete/create a vector that contains all those values below 10. It should be noted that there is values missing (NA) with in M. I have tried everything I can think of.
Examples of codes I have tried:
if (M<10,D==M) , where D is an empty vector
if (M<10 || M%in%NA) {D==M}
I have tried others, such as the use of list.append. I am absolutely stuck.
Thank You!!!!! I was making that so much harder than it was. Just so I understand the code. What exactly is M[M<10] doing? If I am correct it is selecting all the index's values which are less than 10, correct?
The comparison M < 10 simply returns TRUE and FALSE values. When used as the indexes to subset a vector, TRUE mean "keep" and FALSE means "don't keep". Here is some code that might help explain that. Notice that the M vector here is not the same as in my previous post.