diff --git a/R/bytes.R b/R/bytes.R index 9e59dc2..9f2f18e 100644 --- a/R/bytes.R +++ b/R/bytes.R @@ -169,16 +169,18 @@ type_sum.bench_bytes <- function(x) { bench_bytes_trans <- function(base = 2) { if (is.null(base)) { return( - scales::trans_new("bch:byt", as.numeric, as_bench_bytes, - scales::pretty_breaks(), domain = c(1e-100, Inf) + scales::trans_new("bch:byt", transform = as.numeric, + inverse = as_bench_bytes, breaks = scales::pretty_breaks(), + domain = c(1e-100, Inf) ) ) } trans <- function(x) log(as.numeric(x), base) inv <- function(x) as_bench_bytes(base ^ as.numeric(x)) - scales::trans_new(paste0("bch:byt-", format(base)), trans, inv, - scales::log_breaks(base = base), domain = c(1e-100, Inf)) + scales::trans_new(paste0("bch:byt-", format(base)), transform = trans, + inverse = inv, breaks = scales::log_breaks(base = base), + domain = c(1e-100, Inf)) } scale_type.bench_bytes <- function(x) "bench_bytes" diff --git a/R/time.R b/R/time.R index 9159edb..3a681e1 100644 --- a/R/time.R +++ b/R/time.R @@ -209,8 +209,9 @@ type_sum.bench_time <- function(x) { bench_time_trans <- function(base = 10) { if (is.null(base)) { return( - scales::trans_new("bch:tm", as.numeric, as_bench_time, - scales::pretty_breaks(), domain = c(1e-100, Inf) + scales::trans_new("bch:tm", transform = as.numeric, + inverse = as_bench_time, breaks = scales::pretty_breaks(), + domain = c(1e-100, Inf) ) ) } @@ -218,8 +219,9 @@ bench_time_trans <- function(base = 10) { trans <- function(x) log(as.numeric(x), base) inv <- function(x) as_bench_time(base ^ as.numeric(x)) - scales::trans_new(paste0("bch:tm-", format(base)), trans, inv, - scales::log_breaks(base = base), domain = c(1e-100, Inf)) + scales::trans_new(paste0("bch:tm-", format(base)), transform = trans, + inverse = inv, breaks = scales::log_breaks(base = base), + domain = c(1e-100, Inf)) } scale_type.bench_time <- function(x) "bench_time"