 Another common way that conditional subsetting is used is to look for specific strings in a long list of items. So to show you an example, we're going to create a new variable here, another string vector called possessions. So using the combined function, we're going to make a list of items starting with car, bicycle, radio, television, and mobile phone. And go ahead and create that item. And now if we wanted to test whether or not a certain item was in that list, you can use conditional subsetting, brackets. Let's say we were interested in whether or not car was in that list. And also if radio was in that list. Again, we're using the double equal sign, okay, along with the disjunction or or operator. Okay, so I spelled possessions wrong and it went and tried to do the same test on an earlier variable that I created, which was actually created with some mistakes in it, which is why I created a new one. So let's go ahead and fix that and run it again. And if the two items are contained in that vector, R will return those two items. If, on the other hand, I said that was not on the list, ran the same list, well, radio will come back, the cell phone will not be returned. So you can imagine that this could get pretty tedious if you have a long list of items that you want to look up. In those cases, it's better to use the in function. So we're going to give an example here. The in function is just the word in inside these two percentage signs. The term on the left here is what's called our search vector, okay. And then on the right, we're going to use a target vector. So what R is going to do now is it's going to take our search vector and our target vector and compare them and then return another vector of true and false values, basically just letting us know whether or not these two terms are contained within possessions. So within our output, you can see here now that bicycle and car both return true because possessions contains car and bicycle as the first and second value. Whereas it also contains these three additional values that don't satisfy that condition or do not match with our target vector. So those return false. Okay, the last thing that we're going to cover in this section is how R deals with missing values. So R, as we mentioned, was created to deal with really large data sets and often data sets contain missing values or they could be NAs or nulls. And so we need to actually tell R how to handle these in order to avoid any kind of confusion. All right, well, let's start with an example. First, we're going to create a new header called missing values. We're going to create a new vector variable. And this vector is going to contain 2, 1, 1. We're going to throw it in NA all by 4. Rooms is now in our global environment with our NA in there. Now, what if we wanted to take the mean of the values contained in this vector? If we did this, just use the mean function. R is going to return NA. And the reason it does this is because it can't calculate the mean of those values as long as that NA is in there. So the way that we correct this is with an additional argument, NARM. And the documentation comes up here. It's just telling you that what you're doing is specifying whether or not you want R to ignore or remove those NA values in running that calculation. Okay, so if we set it to true and run it again, now it returns the output 2, which is just the mean of all the non null values in that vector. This argument works in conjunction with a lot of different functions that serve to kind of return summary statistics. So another example would be maximum. Okay, max would return the max value of that vector. But again, because it contains the NA, it can't do it. If we use that optional argument, that'll give us 4. Now, R has a lot more functions that can be used to handle null values in different ways. Some of these are for extracting all the non null values. Others are for counting those null values. So for a more comprehensive list of those functions, refer to page 21 in the PDF. And then check out the practice exercises at the end if you want some additional practice for the skill. Okay, that wraps up lesson two of this series. In our next lesson, we're going to be getting started with data, talking about data frames, which are another really common data type used in R. Also talking a little bit about how to get some summary information about an entire data set and a lot of other things. We'll hope you stay tuned. Just click on the next video to continue the series.