Convert incident object to a data frame
Usage
# S3 method for class 'incidence2'
as.data.frame(x, row.names, optional, ...)
Arguments
- x
incidence2 object.
- row.names
Not used.
- optional
Not used.
- ...
Not used.
See also
as.data.frame for the underlying generic.
Examples
dat <- data.frame(
dates = Sys.Date() + 1:100,
names = rep(c("Jo", "John"), 5)
)
dat <- incidence(dat, date_index = "dates", groups = "names")
as.data.frame(dat)
#> date_index names count_variable count
#> 1 2024-11-14 Jo dates 1
#> 2 2024-11-15 John dates 1
#> 3 2024-11-16 Jo dates 1
#> 4 2024-11-17 John dates 1
#> 5 2024-11-18 Jo dates 1
#> 6 2024-11-19 John dates 1
#> 7 2024-11-20 Jo dates 1
#> 8 2024-11-21 John dates 1
#> 9 2024-11-22 Jo dates 1
#> 10 2024-11-23 John dates 1
#> 11 2024-11-24 Jo dates 1
#> 12 2024-11-25 John dates 1
#> 13 2024-11-26 Jo dates 1
#> 14 2024-11-27 John dates 1
#> 15 2024-11-28 Jo dates 1
#> 16 2024-11-29 John dates 1
#> 17 2024-11-30 Jo dates 1
#> 18 2024-12-01 John dates 1
#> 19 2024-12-02 Jo dates 1
#> 20 2024-12-03 John dates 1
#> 21 2024-12-04 Jo dates 1
#> 22 2024-12-05 John dates 1
#> 23 2024-12-06 Jo dates 1
#> 24 2024-12-07 John dates 1
#> 25 2024-12-08 Jo dates 1
#> 26 2024-12-09 John dates 1
#> 27 2024-12-10 Jo dates 1
#> 28 2024-12-11 John dates 1
#> 29 2024-12-12 Jo dates 1
#> 30 2024-12-13 John dates 1
#> 31 2024-12-14 Jo dates 1
#> 32 2024-12-15 John dates 1
#> 33 2024-12-16 Jo dates 1
#> 34 2024-12-17 John dates 1
#> 35 2024-12-18 Jo dates 1
#> 36 2024-12-19 John dates 1
#> 37 2024-12-20 Jo dates 1
#> 38 2024-12-21 John dates 1
#> 39 2024-12-22 Jo dates 1
#> 40 2024-12-23 John dates 1
#> 41 2024-12-24 Jo dates 1
#> 42 2024-12-25 John dates 1
#> 43 2024-12-26 Jo dates 1
#> 44 2024-12-27 John dates 1
#> 45 2024-12-28 Jo dates 1
#> 46 2024-12-29 John dates 1
#> 47 2024-12-30 Jo dates 1
#> 48 2024-12-31 John dates 1
#> 49 2025-01-01 Jo dates 1
#> 50 2025-01-02 John dates 1
#> 51 2025-01-03 Jo dates 1
#> 52 2025-01-04 John dates 1
#> 53 2025-01-05 Jo dates 1
#> 54 2025-01-06 John dates 1
#> 55 2025-01-07 Jo dates 1
#> 56 2025-01-08 John dates 1
#> 57 2025-01-09 Jo dates 1
#> 58 2025-01-10 John dates 1
#> 59 2025-01-11 Jo dates 1
#> 60 2025-01-12 John dates 1
#> 61 2025-01-13 Jo dates 1
#> 62 2025-01-14 John dates 1
#> 63 2025-01-15 Jo dates 1
#> 64 2025-01-16 John dates 1
#> 65 2025-01-17 Jo dates 1
#> 66 2025-01-18 John dates 1
#> 67 2025-01-19 Jo dates 1
#> 68 2025-01-20 John dates 1
#> 69 2025-01-21 Jo dates 1
#> 70 2025-01-22 John dates 1
#> 71 2025-01-23 Jo dates 1
#> 72 2025-01-24 John dates 1
#> 73 2025-01-25 Jo dates 1
#> 74 2025-01-26 John dates 1
#> 75 2025-01-27 Jo dates 1
#> 76 2025-01-28 John dates 1
#> 77 2025-01-29 Jo dates 1
#> 78 2025-01-30 John dates 1
#> 79 2025-01-31 Jo dates 1
#> 80 2025-02-01 John dates 1
#> 81 2025-02-02 Jo dates 1
#> 82 2025-02-03 John dates 1
#> 83 2025-02-04 Jo dates 1
#> 84 2025-02-05 John dates 1
#> 85 2025-02-06 Jo dates 1
#> 86 2025-02-07 John dates 1
#> 87 2025-02-08 Jo dates 1
#> 88 2025-02-09 John dates 1
#> 89 2025-02-10 Jo dates 1
#> 90 2025-02-11 John dates 1
#> 91 2025-02-12 Jo dates 1
#> 92 2025-02-13 John dates 1
#> 93 2025-02-14 Jo dates 1
#> 94 2025-02-15 John dates 1
#> 95 2025-02-16 Jo dates 1
#> 96 2025-02-17 John dates 1
#> 97 2025-02-18 Jo dates 1
#> 98 2025-02-19 John dates 1
#> 99 2025-02-20 Jo dates 1
#> 100 2025-02-21 John dates 1