Current best practice (tidyverse) is:
require(dplyr)
df1 %>% count(Year, Month)
More Related Contents:
- How to sum a variable by group
- Aggregate / summarize multiple variables per group (e.g. sum, mean)
- Collapse / concatenate / aggregate a column to a single comma separated string within each group
- Sort (order) data frame rows by multiple columns
- The difference between bracket [ ] and double bracket [[ ]] for accessing the elements of a list or dataframe
- Numbering rows within groups in a data frame
- Calculate the mean by group
- Select the row with the maximum value in each group
- Filter data.frame rows by a logical condition
- Remove rows with all or some NAs (missing values) in data.frame
- Drop unused factor levels in a subsetted data frame
- Split data.frame based on levels of a factor into new data.frames
- Combine a list of data frames into one data frame by row
- Subset data frame based on number of rows per group
- Drop data frame columns by name
- How to split a data frame?
- Why is it not advisable to use attach() in R, and what should I use instead?
- Create an empty data.frame
- How to plot all the columns of a data frame in R
- Sample random rows in dataframe
- Extracting specific columns from a data frame
- Select the first and last row by group in a data frame
- Subset / filter rows in a data frame based on a condition in a column
- How does one reorder columns in a data frame?
- Rename multiple columns by names
- Convert a dataframe to a vector (by rows)
- Should I use a data.frame or a matrix?
- Apply several summary functions (sum, mean, etc.) on several variables by group in one call
- Re-ordering factor levels in data frame [duplicate]
- Convert list to data frame while keeping list-element names