You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Created attachment 1992 [details]
Support for JEDEC symbols to utils/R/object.size.R
As a follow up to PR #16649 (implemented in r69869 & r69879) on the IEC standard for binary byte size units (e.g. KiB, MiB, ...), I'd like to add formal support for the JEDEC standard, e.g. KB, MB, and GB. The latter is also a customary standard.
This also brings up the issue with the current units used by R, i.e. Kb, Mb, and Gb. As far as I know, these are not part of any standards. It's especially unfortunate that 'b' is used, because that is standard for 'bit', whereas 'B' is used for 'byte'.
Until a decision is made to drop the history R units/symbols, I propose the attached backward-compatible patch that (in addition to IEC units) now supports output of JEDEC+customary units. This patch should make it easy to transition away from the current R units/symbols and eventually deprecated them if wanted.
Example output:
## R
format(structure(1e8, class = "object_size"), units="Mb")
[1] "95.4 Mb"
## JEDEC (this patch)
format(structure(1e8, class = "object_size"), units="MB")
[1] "95.4 MB"
## IEC (recently added)
format(structure(1e8, class = "object_size"), units="MiB")
[1] "95.4 MiB"
I'm holding back on the Rd patch in case you choose a different route.
I don't have strong opinions on this,
but we should note that this proposal is not full back compatible (outputs will change).
I do have a strong opinion on the SI standard, at least "in general": It is the standard that should come first whereever it applies.
Here we have the problem that the SI standard is different than the JEDEC one,
so I would not want to endorse JEDEC at all.
(see also my comment on your github issue ..)
So, if we change the default output here, and want to follow standards and be unambigous, I think we should "KiB" etc (at least from 'auto')..
Created attachment 1992 [details]
Support for JEDEC symbols to utils/R/object.size.R
As a follow up to PR #16649 (implemented in r69869 & r69879) on the IEC standard for binary byte size units (e.g. KiB, MiB, ...), I'd like to add formal support for the JEDEC standard, e.g. KB, MB, and GB. The latter is also a customary standard.
This also brings up the issue with the current units used by R, i.e. Kb, Mb, and Gb. As far as I know, these are not part of any standards. It's especially unfortunate that 'b' is used, because that is standard for 'bit', whereas 'B' is used for 'byte'.
Until a decision is made to drop the history R units/symbols, I propose the attached backward-compatible patch that (in addition to IEC units) now supports output of JEDEC+customary units. This patch should make it easy to transition away from the current R units/symbols and eventually deprecated them if wanted.
Example output:
## R
[1] "95.4 Mb"
## JEDEC (this patch)
[1] "95.4 MB"
## IEC (recently added)
[1] "95.4 MiB"
I'm holding back on the Rd patch in case you choose a different route.
For background/my notes, feel free to see HenrikBengtsson/Wishlist-for-R#6
Thank you
Henrik
METADATA
The text was updated successfully, but these errors were encountered: