size_humanreadable: Human-readable File Size

View source: R/character.R

size_humanreadableR Documentation

Human-readable File Size

Description

Formats bytes into human-readable units, from "kB" (10^3) to "YB" (10^23).

Usage

size_humanreadable(bytes, decimals = 1, decimal.mark = dec_mark())

Arguments

bytes

number of bytes

decimals

precision, not used for bytes and kilobytes

decimal.mark

decimal mark to use, defaults to dec_mark()

Details

If using object.size() on an object, this function is equal to using format2() to format the object size.

Examples

size_humanreadable(c(12, 1234, 123456, 12345678))

size_humanreadable(1024 ^ c(0:4))

certe-medical-epidemiology/certetoolbox documentation built on April 17, 2025, 3:24 a.m.