filter() function in
R Language is used to choose cases and filtering out the values based on the filtering expression.
Syntax: filter(x, expr)
Parameters:
x: Object to be filtered
expr: expression as a base for filtering
Example 1:
Output:
name age ht school
1 Abhi 7 46 yes
2 Bhavesh 5 NA yes
3 Chaman 9 NA no
4 Dimri 16 69 no
name age ht school
1 Bhavesh 5 NA yes
2 Chaman 9 NA no
name age ht school
1 Abhi 7 46 yes
2 Dimri 16 69 no
Example 2:
Output:
name age ht school
1 Abhi 7 46 yes
2 Bhavesh 5 NA no
3 Chaman 9 NA yes
4 Dimri 16 69 no
name age ht school
1 Abhi 7 46 yes
2 Chaman 9 NA yes
name age ht school
1 Bhavesh 5 NA no
2 Dimri 16 69 no