Home > Software engineering >  Which function has superseded the trans_break function in the scales package for R?
Which function has superseded the trans_break function in the scales package for R?

Time:10-01

This might not be a coding question per se, but I don't know where else to ask it.

The documentation of the scales pacakge for R says that the trans_breaks function has been superseded. However, I can't seem to find what is the new, better alternative function. Does anyone have an idea?

CodePudding user response:

As far as I can tell the only specialized breaks-calculating function for transformed scales is log_breaks(). trans_new() uses breaks = extended_breaks by default. The only transformations I can find that overrides this default are log_trans() (which is called by log2_trans() and log10_trans(), which uses log_breaks(), and the date/time transformations (date_trans, hms_trans, time_trans), which use time_breaks or breaks_pretty ...

fn_compare <- function(f1, f2) identical(deparse(f1), deparse(f2))
trans_list <- apropos("_trans")
invisible(sapply(trans_list,
   function(f) {
      cat(f,": ")
      d <- deparse(get(f))
      w <- grep("trans_new", d)
      if (length(w) == 0) cat("\n") else cat(d[w:(w 1)], "\n")
   }
))
  •  Tags:  
  • r
  • Related