I have a data set and I want to extract the restaurant name by rating and state. I want to write a function with two arguments: state and rating.
> rest_data
restaurant_name rating state visitors_per_day
1 a 3.4 NY 34
2 b 5.0 CA 20
3 c 4.0 NY 11
4 d 4.3 AZ 34
5 e 4.9 NY 14
6 f 3.0 CA 21
This is how I should call the function: state name and the rating
my_function("NY", 4.9)
I tried various ways but I was only able to extract using 1 argument.
Thank you