Description Usage Arguments Examples
View source: R/use-metrics-scaffold.R
Use this to generate a YAML scaffold for documenting metrics, just prior to running
create_metrics()
. You can place this into the header of an Rmd and
fill in the names and descriptions.
1 | use_metrics_scaffold(tbl)
|
tbl |
A wide metric tbl, including |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | library(dplyr)
flights <- nycflights13::flights %>%
mutate(date = as.Date(ISOdate(year, month, day)))
# find flight delays by week, month, and quarter
flight_summary <- flights %>%
cross_by_dimensions(origin) %>%
cross_by_periods() %>%
summarize(
nb_flights = n(),
avg_arr_delay = mean(arr_delay, na.rm = TRUE)
)
use_metrics_scaffold(flight_summary)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.