I encountered this case where the numbers on the axis fail if the combination of trans and unit is used. I would expect the numbers in the transformed case to still range from 1 to 10 just as when the transformation is not used:
require(ggplot2)
#> Loading required package: ggplot2
require(units)
#> Loading required package: units
#> udunits database from /usr/share/xml/udunits/udunits2.xml
d<-data.frame(x=set_units((1:10)*60,'min'), y=1:10)
# values nicely range from 60 minutes to 600 minutes
ggplot(d)+geom_point(aes(x=x,y=y))+scale_x_units(trans='log10')
# using hours the range should be
range(set_units(d$x,'h'))
#> Units: [h]
#> [1] 1 10
# which works correctly when not transforming
ggplot(d)+geom_point(aes(x=x,y=y))+scale_x_units(unit='h')
# however the combination of transforming and changing units seems to fail
ggplot(d)+geom_point(aes(x=x,y=y))+scale_x_units(unit='h', trans='log10')
I encountered this case where the numbers on the axis fail if the combination of
trans
andunit
is used. I would expect the numbers in the transformed case to still range from 1 to 10 just as when the transformation is not used: