Learn R Programming

xfun (version 0.48)

format_bytes: Format numbers of bytes using a specified unit

Description

Call the S3 method format.object_size() to format numbers of bytes.

Usage

format_bytes(x, units = "auto", ...)

Value

A character vector.

Arguments

x

A numeric vector (each element represents a number of bytes).

units, ...

Passed to format().

Examples

Run this code
xfun::format_bytes(c(1, 1024, 2000, 1e+06, 2e+08))
xfun::format_bytes(c(1, 1024, 2000, 1e+06, 2e+08), units = "KB")

Run the code above in your browser using DataLab