human_filesize: Human-readable binary file size

View source: R/download_zenodo.R

human_filesizeR Documentation

Human-readable binary file size

Description

Takes an integer (referring to number of bytes) and returns an optimally human-readable binary-prefixed byte size (KiB, MiB, GiB, TiB, PiB, EiB). The function is vectorised.

Usage

human_filesize(x)

Arguments

x

A positive integer, i.e. the number of bytes (B). Can be a vector of file sizes.

Value

A character vector.

Author(s)

Floris Vanderhaeghe, floris.vanderhaeghe@inbo.be

Examples

human_filesize(7845691)
v <- c(12345, 456987745621258)
human_filesize(v)


inbo/inborutils documentation built on Nov. 23, 2023, 4:42 a.m.