Reputation: 480
for the below data, can we plot ggplot across categories as shown below. Basically y axis is the count of customers across Months
df
Date App Customers
Jan-01 A Cust1
Feb-01 B Cust2
Mar-01 A Cust1
Apr-01 B Cust2
May-01 C Cust1
Upvotes: 0
Views: 168
Reputation: 389235
You can count
number of rows for each Month and App
and plot the data.
library(dplyr)
library(ggplot2)
df %>%
count(Date, App) %>%
mutate(Date = as.Date(paste0(Date, '-01'), '%b-%y-%d')) %>%
ggplot(aes(Date, n, color = App)) +
geom_line() +
scale_x_date(date_labels = '%b %Y')
Upvotes: 2