|
105 | 105 | #' then the current day-time will be used.
|
106 | 106 | #' @param additional_metadata List of additional metadata to attach to the
|
107 | 107 | #' `epi_df` object. The metadata will have `geo_type`, `time_type`, and
|
108 |
| -#' `as_of` fields; named entries from the passed list or will be included as |
109 |
| -#' well. |
| 108 | +#' `as_of` fields; named entries from the passed list will be included as |
| 109 | +#' well. If your tibble has additional keys, be sure to specify them |
| 110 | +#' in the `other_keys` component of `additional_metadata`. |
110 | 111 | #' @param ... Additional arguments passed to methods.
|
111 | 112 | #' @return An `epi_df` object.
|
112 | 113 | #'
|
@@ -188,8 +189,9 @@ new_epi_df = function(x = tibble::tibble(), geo_type, time_type, as_of,
|
188 | 189 | #' then the current day-time will be used.
|
189 | 190 | #' @param additional_metadata List of additional metadata to attach to the
|
190 | 191 | #' `epi_df` object. The metadata will have `geo_type`, `time_type`, and
|
191 |
| -#' `as_of` fields; named entries from the passed list or will be included as |
192 |
| -#' well. |
| 192 | +#' `as_of` fields; named entries from the passed list will be included as |
| 193 | +#' well. If your tibble has additional keys, be sure to specify them |
| 194 | +#' in the `other_keys` component of `additional_metadata`. |
193 | 195 | #' @param ... Additional arguments passed to methods.
|
194 | 196 | #' @return An `epi_df` object.
|
195 | 197 | #'
|
@@ -248,9 +250,12 @@ new_epi_df = function(x = tibble::tibble(), geo_type, time_type, as_of,
|
248 | 250 | #'
|
249 | 251 | #' ex3 <- ex3_input %>%
|
250 | 252 | #' tsibble::as_tsibble() %>% # needed to add the additional metadata
|
| 253 | +#' # add 2 extra keys |
251 | 254 | #' dplyr::mutate(
|
252 | 255 | #' state = rep("MA",6),
|
253 |
| -#' pol = rep(c("blue", "swing", "swing"), each = 2)) %>% # 2 extra keys |
| 256 | +#' pol = rep(c("blue", "swing", "swing"), each = 2)) %>% |
| 257 | +#' # the 2 extra keys we added have to be specified in the other_keys |
| 258 | +#' # component of additional_metadata. |
254 | 259 | #' as_epi_df(additional_metadata = list(other_keys = c("state", "pol")))
|
255 | 260 | #'
|
256 | 261 | #' attr(ex3,"metadata")
|
|
0 commit comments