@@ -222,14 +222,14 @@ revision_analysis <- function(epi_arch,
222222}
223223
224224# ' @export
225- print.revision_behavior <- function (rev_beh , ... ) {
226- revision_behavior <- rev_beh $ revision_behavior
225+ print.revision_behavior <- function (x , ... ) {
226+ revision_behavior <- x $ revision_behavior
227227 cli :: cli_h2(" An epi_archive spanning {.val {rev_beh$range_time_values[1]}} to {.val {rev_beh$range_time_values[1]}}." )
228228 cli :: cli_h3(" Min lag (time to first version):" )
229- time_delta_summary(revision_behavior $ min_lag , rev_beh $ time_type ) %> % print()
230- if (! rev_beh $ drop_nas ) {
229+ time_delta_summary(revision_behavior $ min_lag , x $ time_type ) %> % print()
230+ if (! x $ drop_nas ) {
231231 cli_inform(" Fraction of all versions that are `NA`:" )
232- cli_li(num_percent(rev_beh $ total_na , rev_beh $ n_obs , " " ))
232+ cli_li(num_percent(x $ total_na , x $ n_obs , " " ))
233233 cli_inform(" " )
234234 }
235235 cli :: cli_h3(" Fraction of epi_key + time_values with" )
@@ -238,14 +238,14 @@ print.revision_behavior <- function(rev_beh, ...) {
238238 cli_inform(" No revisions:" )
239239 cli_li(num_percent(total_num_unrevised , total_num , " " ))
240240 total_quickly_revised <- sum( # nolint: object_usage_linter
241- time_delta_to_n_steps(revision_behavior $ max_lag , rev_beh $ time_type ) < =
242- time_delta_to_n_steps(rev_beh $ quick_revision , rev_beh $ time_type )
241+ time_delta_to_n_steps(revision_behavior $ max_lag , x $ time_type ) < =
242+ time_delta_to_n_steps(x $ quick_revision , x $ time_type )
243243 )
244244 cli_inform(" Quick revisions (last revision within {format_time_delta(rev_beh$quick_revision, rev_beh$time_type)}
245245 of the `time_value`):" )
246246 cli_li(num_percent(total_quickly_revised , total_num , " " ))
247247 total_barely_revised <- sum( # nolint: object_usage_linter
248- revision_behavior $ n_revisions < = rev_beh $ few_revisions
248+ revision_behavior $ n_revisions < = x $ few_revisions
249249 )
250250 cli_inform(" Few revisions (At most {rev_beh$few_revisions} revisions for that `time_value`):" )
251251 cli_li(num_percent(total_barely_revised , total_num , " " ))
@@ -256,23 +256,23 @@ print.revision_behavior <- function(rev_beh, ...) {
256256 n_real_revised <- nrow(real_revisions ) # nolint: object_usage_linter
257257 rel_spread <- sum( # nolint: object_usage_linter
258258 real_revisions $ rel_spread <
259- rev_beh $ rel_spread_threshold ,
259+ x $ rel_spread_threshold ,
260260 na.rm = TRUE
261261 ) + sum(is.na(real_revisions $ rel_spread ))
262262 cli_inform(" Less than {rev_beh$rel_spread_threshold} spread in relative value:" )
263263 cli_li(num_percent(rel_spread , n_real_revised , " " ))
264264 abs_spread <- sum( # nolint: object_usage_linter
265265 real_revisions $ spread >
266- rev_beh $ abs_spread_threshold
266+ x $ abs_spread_threshold
267267 ) # nolint: object_usage_linter
268268 cli_inform(" Spread of more than {rev_beh$abs_spread_threshold} in actual value (when revised):" )
269269 cli_li(num_percent(abs_spread , n_real_revised , " " ))
270270
271271 # time_type_unit_pluralizer[[time_type]] is a format string controlled by us
272272 # and/or downstream devs, so we can paste it onto our format string safely:
273- units_plural <- pluralize(paste0(" {qty(2)}" , time_type_unit_pluralizer [[rev_beh $ time_type ]])) # nolint: object_usage_linter
273+ units_plural <- pluralize(paste0(" {qty(2)}" , time_type_unit_pluralizer [[x $ time_type ]])) # nolint: object_usage_linter
274274 cli :: cli_h3(" {toTitleCase(units_plural)} until within {rev_beh$within_latest*100}% of the latest value:" )
275- time_delta_summary(revision_behavior [[" lag_near_latest" ]], rev_beh $ time_type ) %> % print()
275+ time_delta_summary(revision_behavior [[" lag_near_latest" ]], x $ time_type ) %> % print()
276276}
277277
278278# ' @export
0 commit comments