If your data is dataframe df
with columns y
and m
library(plyr)
counts <- ddply(df, .(df$y, df$m), nrow)
names(counts) <- c("y", "m", "Freq")
More Related Contents:
- Change R default library path using .libPaths in Rprofile.site fails to work
- Sample random rows in dataframe
- Left join using data.table
- Subset / filter rows in a data frame based on a condition in a column
- Coerce multiple columns to factors at once
- How to display only integer values on an axis using ggplot2
- Aggregate multiple columns at once [duplicate]
- Run VBA script from R
- dynamically add plots to web page using shiny
- How to listen for more than one event expression within a Shiny eventReactive handler
- Place a legend for each facet_wrap grid in ggplot2
- Import text file as single character string
- R tick data : merging date and time into a single object
- Finding the indexes of multiple/overlapping matching substrings
- Controlling line color and line type in ggplot legend
- How to display all x labels in R barplot?
- Replacing numbers within a range with a factor [duplicate]
- Find the intersection of overlapping ranges in two tables using data.table function foverlaps
- Create a matrix of scatterplots (pairs() equivalent) in ggplot2
- How to make graphics with transparent background in R using ggplot2?
- Referring to data.table columns by names saved in variables
- What is integer overflow in R and how can it happen?
- Exactly storing large integers
- R semicolon delimited a column into rows
- How to deal with nonstandard column names (white space, punctuation, starts with numbers)
- Combinations by group in R
- Function to concatenate paths?
- How can I label points in this scatterplot?
- Error when using predict() on a randomForest object trained with caret’s train() using formula
- Dealing with very small numbers in R