Hello in this lecture we're going to learn how to filter out data using the reply or package for example.
We're going to use the same demodulator crame that contains information about a group of carpoolers
and new data are claimed to be created.
Each time we run a filtering operation first of all we have to load the package using the function require
OK.
And now let's filter our data or frame the more keeping the unmarried object all all.
So you think one filter variable in the player package we have a function called Filter which is pretty
simular with the top set function in the base or a cell in the filter function.
We must first battlecry the data in the initial data frame Deeble and then the filtering condition.
So the variable marital must be equal to marriage.
OK let's try this.
As you can see only on marriage people who are still Lactaid were kept in the new date of frame D-Mo.
to
OK if you want to use two fields of variables for example if they are married subjects only aged under
50.
In this case you will use two sweltering conditions in the field or Fanshen but that is filtering conditions
are not separated by an ampersand but by a coma.
So first is better by the data frame and then the conditions marital equal to unmarried coma age lower
than 50.
That's Ronit.
So in the new data frame D-Mo. to all in all they are married subjects with the age under 50 were retained.
Now what to do if you want to keep all these variables.
Well in this case with the filter function in the deep layer package you must first specify the variables
you want to keep.
So before filtering out the cases that the bullet that we want to keep only the first three variables
age marital status and income to do that we will use the select function.
So either Tonton we aspect of fight that the data frame the more and then the variable we want to keep
separated by call so age marital and income and new data of gray D-Mo. to be created that is that
OK.
The verbal D-Mo. to contain only three columns.
And now we can filter with new data or frame D-Mo. to keeping all the they are married persons aged
under 50.
So we applied to the variable the more to filter with the conditions marital people to our marriage
and aged lower them day of day.
That's why this as an artist or gravel sorry our date frame containing only the marriage subjects aged
under 50.
Also the latter.
Thank you.