Skip to content

Commit 0693a21

Browse files
committed
Tweak tsibble -> epi_df example explanation
1 parent e1f8504 commit 0693a21

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

R/epi_df.R

+7-3
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ NULL
115115
#' # Convert a `tsibble` that has county code as an extra key
116116
#' # Notice that county code should be a character string to preserve any leading zeroes
117117
#'
118-
#' # `other_keys` are specified in the `key` parameter
119-
#' # in the `as_tsibble()` function, along with the primary key
120118
#' ex1_input <- tibble::tibble(
121119
#' geo_value = rep(c("ca", "fl", "pa"), each = 3),
122120
#' county_code = c("06059","06061","06067",
@@ -128,8 +126,12 @@ NULL
128126
#' ) %>%
129127
#' tsibble::as_tsibble(index = time_value, key = c(geo_value, county_code))
130128
#'
129+
#' # The `other_keys` metadata (`"county_code"` in this case) is automatically
130+
#' # inferred from the `tsibble`'s `key`:
131131
#' ex1 <- as_epi_df(x = ex1_input, geo_type = "state", time_type = "day", as_of = "2020-06-03")
132-
#' attr(ex1,"metadata")
132+
#' attr(ex1,"metadata")[["other_keys"]]
133+
#'
134+
#'
133135
#'
134136
#' # Dealing with misspecified column names:
135137
#' # Geographical and temporal information must be provided in columns named
@@ -153,6 +155,8 @@ NULL
153155
#'
154156
#' attr(ex2,"metadata")
155157
#'
158+
#'
159+
#'
156160
#' # Adding additional keys to an `epi_df` object
157161
#'
158162
#' ex3_input <- jhu_csse_county_level_subset %>%

man/as_epi_df.Rd

+7-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)