Delete rows of a column using another column statistics in R I have a dataframe with the following columns:



If a year (see "year" column) has less than 10 weeks reported, I would like to delete it from the dataframe. The column "weeks_reporting" gives the order of the week in a year. How can I accomplish this task in R?
You can accomplish this using a logic index as follows:

us_contagious_diseases&lt;-us_contagious_diseases[!(us_contagious_diseases$weeks_reporting&lt;"10"),]