The number of Wynton users over time

users_over_time(file = NULL, since = "2017-01-01")

Arguments

file

A file with a single column of signup dates, or NULL. If NULL, then the Wynton LDAP server is queried.

since

Drop signup dates prior to this date.

Value

A tibble::tibble with columns date and total, total the cumulative sum based on date occurances.

Examples

library(dplyr)
#> 
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#> 
#>     filter, lag
#> The following objects are masked from ‘package:base’:
#> 
#>     intersect, setdiff, setequal, union

pathname <- system.file("exdata", "ldap_wynton_dates.txt", package = "wyntonquery")

signups <- users_over_time(pathname)
print(head(signups))
#> # A tibble: 6 × 2
#>   date       total
#>   <date>     <int>
#> 1 2017-02-21    13
#> 2 2017-04-25    14
#> 3 2017-05-23    15
#> 4 2017-07-04    16
#> 5 2017-08-10    17
#> 6 2017-08-11    18
print(tail(signups))
#> # A tibble: 6 × 2
#>   date       total
#>   <date>     <int>
#> 1 2025-08-26  1292
#> 2 2025-08-26  1293
#> 3 2025-08-26  1294
#> 4 2025-08-26  1295
#> 5 2025-08-27  1296
#> 6 2025-08-27  1297

## Summarize by year and month
signups <- mutate(signups, year = format(date, "%Y"))

## Signups per calendar year
signups <- mutate(signups, month = format(date, "%m"))
signups <- group_by(signups, year)
signups_per_year <- count(signups, name = "change")
signups_end_of_year <- filter(signups, date == max(date), total == max(total))
signups_per_year <- left_join(signups_per_year, signups_end_of_year)
#> Joining with `by = join_by(year)`
signups_per_year <- select(signups_per_year, year, change, total, per = date)
print(signups_per_year, n = Inf)
#> # A tibble: 9 × 4
#> # Groups:   year [9]
#>   year  change total per       
#>   <chr>  <int> <int> <date>    
#> 1 2017      17    29 2017-12-05
#> 2 2018      20    49 2018-11-30
#> 3 2019      85   134 2019-12-18
#> 4 2020     100   234 2020-12-22
#> 5 2021     116   350 2021-12-18
#> 6 2022     153   503 2022-12-21
#> 7 2023     180   683 2023-12-27
#> 8 2024     306   989 2024-12-28
#> 9 2025     308  1297 2025-08-27

## Signups per calendar month
signups <- group_by(signups, year, month)
signups_per_month <- count(signups, name = "change")
signups_end_of_month <- filter(signups, date == max(date), total == max(total))
signups_per_month <- left_join(signups_per_month, signups_end_of_month)
#> Joining with `by = join_by(year, month)`
signups_per_month <- select(signups_per_month, year, month, change, total, per = date)
print(signups_per_month, n = Inf)
#> # A tibble: 98 × 5
#> # Groups:   year, month [98]
#>    year  month change total per       
#>    <chr> <chr>  <int> <int> <date>    
#>  1 2017  02         1    13 2017-02-21
#>  2 2017  04         1    14 2017-04-25
#>  3 2017  05         1    15 2017-05-23
#>  4 2017  07         1    16 2017-07-04
#>  5 2017  08         2    18 2017-08-11
#>  6 2017  09         2    20 2017-09-22
#>  7 2017  10         2    22 2017-10-24
#>  8 2017  11         6    28 2017-11-21
#>  9 2017  12         1    29 2017-12-05
#> 10 2018  01         1    30 2018-01-16
#> 11 2018  02         4    34 2018-02-26
#> 12 2018  03         2    36 2018-03-29
#> 13 2018  05         2    38 2018-05-14
#> 14 2018  07         1    39 2018-07-18
#> 15 2018  08         4    43 2018-08-30
#> 16 2018  09         3    46 2018-09-07
#> 17 2018  10         1    47 2018-10-12
#> 18 2018  11         2    49 2018-11-30
#> 19 2019  01         1    50 2019-01-17
#> 20 2019  02        11    61 2019-02-21
#> 21 2019  03        14    75 2019-03-22
#> 22 2019  04         9    84 2019-04-30
#> 23 2019  05         6    90 2019-05-20
#> 24 2019  06         6    96 2019-06-30
#> 25 2019  07         7   103 2019-07-29
#> 26 2019  08         4   107 2019-08-31
#> 27 2019  09        14   121 2019-09-28
#> 28 2019  10         5   126 2019-10-31
#> 29 2019  11         4   130 2019-11-26
#> 30 2019  12         4   134 2019-12-18
#> 31 2020  01         6   140 2020-01-29
#> 32 2020  02         6   146 2020-02-29
#> 33 2020  03         8   154 2020-03-25
#> 34 2020  04         6   160 2020-04-20
#> 35 2020  05        11   171 2020-05-29
#> 36 2020  06         2   173 2020-06-19
#> 37 2020  07        12   185 2020-07-29
#> 38 2020  08        15   200 2020-08-31
#> 39 2020  09        11   211 2020-09-21
#> 40 2020  10        10   221 2020-10-30
#> 41 2020  11         9   230 2020-11-19
#> 42 2020  12         4   234 2020-12-22
#> 43 2021  01        10   244 2021-01-28
#> 44 2021  02        10   254 2021-02-26
#> 45 2021  03        10   264 2021-03-25
#> 46 2021  04         6   270 2021-04-27
#> 47 2021  05         7   277 2021-05-21
#> 48 2021  06         8   285 2021-06-30
#> 49 2021  07         5   290 2021-07-27
#> 50 2021  08        11   301 2021-08-30
#> 51 2021  09        16   317 2021-09-30
#> 52 2021  10        13   330 2021-10-27
#> 53 2021  11        11   341 2021-11-25
#> 54 2021  12         9   350 2021-12-18
#> 55 2022  01        11   361 2022-01-30
#> 56 2022  02        10   371 2022-02-26
#> 57 2022  03        18   389 2022-03-31
#> 58 2022  04         9   398 2022-04-27
#> 59 2022  05        10   408 2022-05-27
#> 60 2022  06         8   416 2022-06-25
#> 61 2022  07         9   425 2022-07-27
#> 62 2022  08        14   439 2022-08-31
#> 63 2022  09        29   468 2022-09-24
#> 64 2022  10        17   485 2022-10-26
#> 65 2022  11        14   499 2022-11-29
#> 66 2022  12         4   503 2022-12-21
#> 67 2023  01        14   517 2023-01-31
#> 68 2023  02        11   528 2023-02-28
#> 69 2023  03        10   538 2023-03-24
#> 70 2023  04        13   551 2023-04-26
#> 71 2023  05         9   560 2023-05-10
#> 72 2023  06        13   573 2023-06-30
#> 73 2023  07        18   591 2023-07-29
#> 74 2023  08        19   610 2023-08-29
#> 75 2023  09        34   644 2023-09-30
#> 76 2023  10        13   657 2023-10-24
#> 77 2023  11        17   674 2023-11-29
#> 78 2023  12         9   683 2023-12-27
#> 79 2024  01        23   706 2024-01-31
#> 80 2024  02        22   728 2024-02-29
#> 81 2024  03        13   741 2024-03-27
#> 82 2024  04        21   762 2024-04-23
#> 83 2024  05        13   775 2024-05-31
#> 84 2024  06        15   790 2024-06-28
#> 85 2024  07        26   816 2024-07-31
#> 86 2024  08        30   846 2024-08-31
#> 87 2024  09        56   902 2024-09-28
#> 88 2024  10        36   938 2024-10-31
#> 89 2024  11        21   959 2024-11-28
#> 90 2024  12        30   989 2024-12-28
#> 91 2025  01        42  1031 2025-01-31
#> 92 2025  02        42  1073 2025-02-28
#> 93 2025  03        36  1109 2025-03-25
#> 94 2025  04        48  1157 2025-04-30
#> 95 2025  05        19  1176 2025-05-28
#> 96 2025  06        27  1203 2025-06-30
#> 97 2025  07        56  1259 2025-07-30
#> 98 2025  08        38  1297 2025-08-27


if (require("ggplot2", quietly = TRUE)) {
  gg <- ggplot(signups, aes(date, total)) + geom_line(linewidth = 2.0)
  gg <- gg + xlab("") + ylab("Number of users")
  gg <- gg + theme(text = element_text(size = 20))
  print(gg)
}