EVOLUTION-MANAGER
Edit File: bytes-class.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Human readable memory sizes</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for bytes-class {rlang}"><tr><td>bytes-class {rlang}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Human readable memory sizes</h2> <h3>Description</h3> <p>Construct, manipulate and display vectors of byte sizes. These are numeric vectors, so you can compare them numerically, but they can also be compared to human readable values such as '10MB'. </p> <ul> <li> <p><code>parse_bytes()</code> takes a character vector of human-readable bytes and returns a structured bytes vector. </p> </li> <li> <p><code>as_bytes()</code> is a generic conversion function for objects representing bytes. </p> </li></ul> <p>Note: A <code>bytes()</code> constructor will be exported soon. </p> <h3>Usage</h3> <pre> as_bytes(x) parse_bytes(x) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>A numeric or character vector. Character representations can use shorthand sizes (see examples).</p> </td></tr> </table> <h3>Details</h3> <p>These memory sizes are always assumed to be base 1000, rather than 1024. </p> <h3>Examples</h3> <pre> parse_bytes("1") parse_bytes("1K") parse_bytes("1Kb") parse_bytes("1KiB") parse_bytes("1MB") parse_bytes("1KB") < "1MB" sum(parse_bytes(c("1MB", "5MB", "500KB"))) </pre> <hr /><div style="text-align: center;">[Package <em>rlang</em> version 1.0.6 <a href="00Index.html">Index</a>]</div> </body></html>