[R] exp / log scaled version of cut?

Uwe Ligges ||gge@ @end|ng |rom @t@t|@t|k@tu-dortmund@de
Thu Feb 3 13:41:35 CET 2022



On 03.02.2022 11:06, Fredrik Karlsson wrote:
> Dear list,
> 
> For tasks involving people its often good to work with ages in exp or log
> scale, since either not much or very much happens in the first 10 years of
> life, and much less (or much more) happens the following years. For tables
> with age range summary statistics, I sometimes would like to have a
> function that would for instance cut a range of values into breaks exp()
> scale equidistance bins, but with unconverted values in the labels.
> 
> Similar to the way log / exp scaling of figure axis tick marks work, but
> with a factor returned.
> 
> i have not been able to find such a function. Is there one?
> 
> Thanks!
> 
> Fredrik Karlsson
> 
> 


Yes, cut():

x <- runif(100, 0, 100)
cut(x, c(0, 10, 100))

Best,
Uwe Ligges



More information about the R-help mailing list