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    10
#> 2 2017-04-25    11
#> 3 2017-05-23    12
#> 4 2017-07-04    13
#> 5 2017-08-10    14
#> 6 2017-08-11    15
print(tail(signups))
#> # A tibble: 6 × 2
#>   date       total
#>   <date>     <int>
#> 1 2026-03-12  1026
#> 2 2026-03-17  1027
#> 3 2026-03-17  1028
#> 4 2026-03-18  1029
#> 5 2026-03-20  1030
#> 6 2026-03-24  1031

## 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: 10 × 4
#> # Groups:   year [10]
#>    year  change total per       
#>    <chr>  <int> <int> <date>    
#>  1 2017      15    24 2017-12-12
#>  2 2018      13    37 2018-11-30
#>  3 2019      60    97 2019-12-11
#>  4 2020      68   165 2020-12-22
#>  5 2021      84   249 2021-12-18
#>  6 2022     105   354 2022-12-21
#>  7 2023     110   464 2023-12-22
#>  8 2024     194   658 2024-12-28
#>  9 2025     285   943 2025-12-23
#> 10 2026      88  1031 2026-03-24

## 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: 103 × 5
#> # Groups:   year, month [103]
#>     year  month change total per       
#>     <chr> <chr>  <int> <int> <date>    
#>   1 2017  02         1    10 2017-02-21
#>   2 2017  04         1    11 2017-04-25
#>   3 2017  05         1    12 2017-05-23
#>   4 2017  07         1    13 2017-07-04
#>   5 2017  08         2    15 2017-08-11
#>   6 2017  09         1    16 2017-09-20
#>   7 2017  10         1    17 2017-10-23
#>   8 2017  11         5    22 2017-11-21
#>   9 2017  12         2    24 2017-12-12
#>  10 2018  01         1    25 2018-01-26
#>  11 2018  02         2    27 2018-02-26
#>  12 2018  03         2    29 2018-03-29
#>  13 2018  05         2    31 2018-05-14
#>  14 2018  07         1    32 2018-07-18
#>  15 2018  08         2    34 2018-08-24
#>  16 2018  09         2    36 2018-09-07
#>  17 2018  11         1    37 2018-11-30
#>  18 2019  02        10    47 2019-02-21
#>  19 2019  03        15    62 2019-03-22
#>  20 2019  04         8    70 2019-04-30
#>  21 2019  05         6    76 2019-05-28
#>  22 2019  06         4    80 2019-06-30
#>  23 2019  07         1    81 2019-07-29
#>  24 2019  08         3    84 2019-08-26
#>  25 2019  09         2    86 2019-09-26
#>  26 2019  10         4    90 2019-10-31
#>  27 2019  11         5    95 2019-11-26
#>  28 2019  12         2    97 2019-12-11
#>  29 2020  01         6   103 2020-01-29
#>  30 2020  02         4   107 2020-02-29
#>  31 2020  03         5   112 2020-03-25
#>  32 2020  04         4   116 2020-04-20
#>  33 2020  05         6   122 2020-05-20
#>  34 2020  06         1   123 2020-06-02
#>  35 2020  07         9   132 2020-07-28
#>  36 2020  08        10   142 2020-08-31
#>  37 2020  09         7   149 2020-09-21
#>  38 2020  10         6   155 2020-10-30
#>  39 2020  11         7   162 2020-11-19
#>  40 2020  12         3   165 2020-12-22
#>  41 2021  01         6   171 2021-01-25
#>  42 2021  02         6   177 2021-02-26
#>  43 2021  03         5   182 2021-03-25
#>  44 2021  04         4   186 2021-04-27
#>  45 2021  05         6   192 2021-05-21
#>  46 2021  06         6   198 2021-06-30
#>  47 2021  07         4   202 2021-07-27
#>  48 2021  08         9   211 2021-08-30
#>  49 2021  09        12   223 2021-09-30
#>  50 2021  10        12   235 2021-10-27
#>  51 2021  11         6   241 2021-11-25
#>  52 2021  12         8   249 2021-12-18
#>  53 2022  01         9   258 2022-01-30
#>  54 2022  02         8   266 2022-02-26
#>  55 2022  03        10   276 2022-03-31
#>  56 2022  04         4   280 2022-04-27
#>  57 2022  05         9   289 2022-05-27
#>  58 2022  06         5   294 2022-06-25
#>  59 2022  07         7   301 2022-07-27
#>  60 2022  08         7   308 2022-08-31
#>  61 2022  09        22   330 2022-09-24
#>  62 2022  10        14   344 2022-10-26
#>  63 2022  11         8   352 2022-11-23
#>  64 2022  12         2   354 2022-12-21
#>  65 2023  01         8   362 2023-01-31
#>  66 2023  02         4   366 2023-02-24
#>  67 2023  03         7   373 2023-03-21
#>  68 2023  04        10   383 2023-04-26
#>  69 2023  05         5   388 2023-05-10
#>  70 2023  06        10   398 2023-06-30
#>  71 2023  07         6   404 2023-07-29
#>  72 2023  08        13   417 2023-08-29
#>  73 2023  09        27   444 2023-09-30
#>  74 2023  10        10   454 2023-10-24
#>  75 2023  11         8   462 2023-11-29
#>  76 2023  12         2   464 2023-12-22
#>  77 2024  01        12   476 2024-01-31
#>  78 2024  02        15   491 2024-02-29
#>  79 2024  03         8   499 2024-03-27
#>  80 2024  04        21   520 2024-04-24
#>  81 2024  05        12   532 2024-05-31
#>  82 2024  06        15   547 2024-06-28
#>  83 2024  07        19   566 2024-07-27
#>  84 2024  08        14   580 2024-08-31
#>  85 2024  09        39   619 2024-09-28
#>  86 2024  10        15   634 2024-10-31
#>  87 2024  11         6   640 2024-11-22
#>  88 2024  12        18   658 2024-12-28
#>  89 2025  01        16   674 2025-01-31
#>  90 2025  02        19   693 2025-02-28
#>  91 2025  03        13   706 2025-03-25
#>  92 2025  04        17   723 2025-04-30
#>  93 2025  05        20   743 2025-05-28
#>  94 2025  06        22   765 2025-06-30
#>  95 2025  07        31   796 2025-07-30
#>  96 2025  08        29   825 2025-08-29
#>  97 2025  09        39   864 2025-09-30
#>  98 2025  10        41   905 2025-10-30
#>  99 2025  11        24   929 2025-11-27
#> 100 2025  12        14   943 2025-12-23
#> 101 2026  01        32   975 2026-01-30
#> 102 2026  02        33  1008 2026-02-24
#> 103 2026  03        23  1031 2026-03-24


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)
}