r-quantities / units

Measurement units for R
https://r-quantities.github.io/units
175 stars 28 forks source link

Unitless options #375

Closed KCEvers closed 2 months ago

KCEvers commented 2 months ago

Hi all,

Thanks for all the work on this package! It's very useful to me for system dynamics modelling.

I was wondering whether it's possible to add two extensions:

  1. Allow mathematical operations between a unitless value and a value without units

    set_units(1, "1") - 1
    Error in Ops.units(set_units(1, "1"), 1) : 
    both operands of the expression should be "units" objects
  2. Set unitless to an arbitrary unit

    set_units(set_units(1, "1"), "seconds")
    Error: cannot convert 1 into s

Best, Kyra Evers

Enchufa2 commented 2 months ago

Thanks for your suggestions.